简体   繁体   中英

SSL config Opencart 3.x

I have SSL working on my site artindia.eu .

When browsing https://www.artindia.eu/laptop-notebook/macs for example, the padlock changes from green to grey in Chrome browser.

I think there is something I need to add or change in catalog/controller/product/category.php, but what I don't know.

Does anyone know?

Its very simple issue usually happen with https and http websites.

For example: is using https

https://www.artindia.eu/laptop-notebook/macs

If you use

// instead of http with all resources on page then padlock will show green icon. as it says unsecured content on the pagee issue.

to elaborate here we have a example

Correct ( href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,900" )

<link href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,900" rel="stylesheet" type="text/css" />

Incorrect ( no need to use http:// when we have https enabled on site.)

<link href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900" rel="stylesheet" type="text/css" />

Solution : Please remove all http from all assets that are loading on website.

I checked the source of your site. You just have made a typo:

Change httpss://www.artindia.eu/image/catalog/AjaxLoader.gif

to https://www.artindia.eu/image/catalog/AjaxLoader.gif

and your site will be fully trusted again.

General issue: all assets loaded including images must be from HTTPS as well.

How to debug by yourself: Use the developer console of your preferred browser to check logs and warnings.

Blockquote

'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url, 'SSL')

Blockquote

I added SSL at the end of this line in ocfilter.php and I added :// after http & https in category.php. Then I disabled the Ajax Navigation modification in de admin panel.

The Ajax Navigation mod changed the links of category/product. Now this is done directly in the controller files.

visit https version of the URL in your browser. For example: http://mywebsite.com/image/catalog/AjaxLoader.gif change to https://mywebsite.com/image/catalog/AjaxLoader.gif IF and only if you get a result of an image. Do the following 1. find a file called header.twig or header.tpl (depend on your opencart version) and open to edit it, Note: If you are are not using opencart default theme then go to the directory of your new theme and search for those files. 2. Insert following code within head section of file.

 <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM