Jump to content

Enable SSL only for a module


Recommended Posts

I've built a module that has a controller. Some clients have disabled SSL on all pages and enabled SSL only on payment page.

On payment page which is secure (https) an ajax called is made to the controller link

 

https

 

that will redirect to http

 

http

 

which will throw this error: This request has been blocked; the content must be served over HTTPS .

 

Obviously.

 

 

So my question is how to force that controller to not redirect to http without enabling SSL on all pages?

 

Thanks

 

Link to comment
Share on other sites

You should force SSL by changing it to

$this->context->link->getModuleLink('modulename', 'modulecontroller', array(), true);

just wanted to clarify that this only forces SSL to be used for that URL, if SSL is enabled in the back office. 

 

If the merchant did not enable SSL, then the URL will still be HTTP only

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...