Secure Web Development: SSL Certificate Is Installed, but Browser Displays Warning

March 21, 2012

Once you installed the CCL certificate on the server you still get the warnings like: Only secure content is displayed in IE, or Page includes other resources which are not secure in Chrome, or site is only partially encrypted. Here is the reason and solution to this problem...

What does this warning mean?

It means that certificate is installed properly, but some of the content is not going from HTTPS, and is not encrypted. In most cases it is images, CSS or JavaScript files.  

How to fix?

Very easy, go through your html files and make sure that instead of path http://domain.com/file.jpg you use either https://domain.com/file.jpg or /file.jpg if possible.

Not correct:

<img src="http://domain.com/file.jpg">

<link rel="stylesheet" type="text/css" href="http://domain.com/file.css"/>

<script type="text/javascript" language="javascript" src="http://domain.com/file.js"></script>

Correct:

<img src="https://domain.com/file.jpg">

<link rel="stylesheet" type="text/css" href="https://domain.com/file.css"/>

<script type="text/javascript" language="javascript" src="https://domain.com/file.js"></script>

Also correct:

<img src="/file.jpg">

<link rel="stylesheet" type="text/css" href="/file.css"/>

<script type="text/javascript" language="javascript" src="/file.js"></script>

 

Here is examples of the warnings:

Only secure content is displayed

Page includes other resources which are not secure

 

site is only partially encrypted