2

I have one issue in my Opencart page. I recently noticed that green bar into browser is not active, and checked my console for errors. I see this warnings:

Mixed Content: The page at 'siteurl' was loaded over HTTPS, but requested an insecure image 'http://siteurl/image/catalog/category/1.png'. This content should also be served over HTTPS.

I checked admin/config.php and have set this:

<?php
// HTTP
define('HTTP_SERVER', 'https://siteurl.com/admin/');
define('HTTP_CATALOG', 'https://siteurl.com/');

 // HTTPS
 define('HTTPS_SERVER', 'https://siteurl.com/admin/');
 define('HTTPS_CATALOG', 'https://siteurl.com/');

 // DIR
 define('DIR_APPLICATION', '/home/public_html/admin/');
 define('DIR_SYSTEM', '/home/public_html/system/');
 define('DIR_IMAGE', '/home/public_html/image/');
 define('DIR_LANGUAGE', '/home/public_html/admin/language/');
define('DIR_TEMPLATE', '/home/public_html/admin/view/template/');
define('DIR_CONFIG', '/home/public_html/system/config/');
 define('DIR_CACHE', '/home/public_html/system/storage/cache/');
 define('DIR_DOWNLOAD', 
'/home//public_html/system/storage/download/');
define('DIR_LOGS', '/home/public_html/system/storage/logs/');
define('DIR_MODIFICATION', 
'/home//public_html/system/storage/modification/');
define('DIR_UPLOAD', '/home/public_html/system/storage/upload/');
define('DIR_CATALOG', '/home/public_html/catalog/');

The same configuration I have is also in siteurl.com/config.php file, but Chrome still give me that yellow warnings, and for that dont mark my site as secured. How do I resolve this? Thanks.

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
DrMTR
  • 499
  • 1
  • 14
  • 35

1 Answers1

2

TL;DR AS the error says:

Mixed Content: The page at 'siteurl' was loaded over HTTPS, but requested an insecure image 'http://siteurl/image/catalog/category/1.png'. This content should also be served over HTTPS.

You are serving insecure image.

Try to find this line in your code/application:

http://siteurl/image/catalog/category/1.png

and replace it with httpS prefix.

so finally everything to be secured in your platform must be served from HTTPS and not HTTP

Open your browser debugger , go to network or console and debug accordingly.

UPDATE: also make sure in your cart setting:

Please go to admin area=> System=>Setting=>Edit Store=>Server=> Enable Use SSL in Security part

Update: October 17

You can also try the following:

  • Important! Create a full backup for your web application (files & databases ...etc) < cPanel example.
  • Enable debug mood in your app if that is available. Through configuration file, PHP Error Log and view server's error log even check your browsers' Dev Tool (F12 in Chrome browser) ... this is a good start to track down an issue in general and HTTPS Mixed content in your case.

  • Disable any custom theme and use default one.

  • Disable plugins one by one and test after each.
  • Update core files to the latest version (bugs happen).
  • Update theme to the latest // some changes and customization might be lost. (ex. For WordPress you can use child-theme to safely update parent theme from source)
  • Update plugins one by one (Backup any customization)
  • After each step test.
  • Check your web application's Forum for similar issues and solutions.
  • Contact your web application developer after trying your best.

Advanced Tip: Take on insecure image and track back to origin where it starts loaded through HTTP and not HTTPS

Some tools that might help you debug and track down the issue:

wpcoder
  • 1,016
  • 11
  • 17
  • if this is the answer to your question you may wish to mark it as answer so others get use of it as well , in addition to let users know this is what you need. – wpcoder Oct 12 '17 at 20:46
  • Im trying to find where that images are hardcoded but dont can find it into template. – DrMTR Oct 12 '17 at 20:48
  • you could post your site URL here or try to use notepad++ search for files. Do you know it? – wpcoder Oct 12 '17 at 20:50
  • first create a backup then try what is in [This post](https://forum.opencart.com/viewtopic.php?f=20&t=103177). Also if that is not the issue, try to bulk search and replace in your template for http into https...find notepad++ search in files feature , check this [image](https://i.stack.imgur.com/OkX6R.png) – wpcoder Oct 12 '17 at 20:59
  • Please go to admin area=> System=>Setting=>Edit Store=>Server=> Enable Use SSL in Security part. – wpcoder Oct 12 '17 at 21:15