369

This morning, upon upgrading my Firefox browser to the latest version (from 22 to 23), some of the key aspects of my back office (website) stopped working.

Looking at the Firebug log, the following errors were being reported:

Blocked loading mixed active content "http://code.jquery.com/ui/1.8.10/themes/smoothness/jquery-ui.css"
Blocked loading mixed active content "http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"`

among other errors caused by the latter of the two above not being loaded.

What does the above mean and how do I resolve it?

Elrond_EGLDer
  • 47,430
  • 25
  • 189
  • 180
Appulus
  • 17,551
  • 10
  • 33
  • 43
  • Hey I have resolved only by doing : https://www.googl.com/maps with //www.googl.com/maps It will work without blocking the content – Ram Balwad Feb 19 '16 at 10:08
  • the ecommerce link is dead (Error - The page you requested could not be found) – Soleil Feb 10 '18 at 21:06

15 Answers15

442

I found this blog post which cleared up a few things. To quote the most relevant bit:

Mixed Active Content is now blocked by default in Firefox 23!

What is Mixed Content?
When a user visits a page served over HTTP, their connection is open for eavesdropping and man-in-the-middle (MITM) attacks. When a user visits a page served over HTTPS, their connection with the web server is authenticated and encrypted with SSL and hence safeguarded from eavesdroppers and MITM attacks.

However, if an HTTPS page includes HTTP content, the HTTP portion can be read or modified by attackers, even though the main page is served over HTTPS. When an HTTPS page has HTTP content, we call that content “mixed”. The webpage that the user is visiting is only partially encrypted, since some of the content is retrieved unencrypted over HTTP. The Mixed Content Blocker blocks certain HTTP requests on HTTPS pages.

The resolution, in my case, was to simply ensure the jquery includes were as follows (note the removal of the protocol):

<link rel="stylesheet" href="//code.jquery.com/ui/1.8.10/themes/smoothness/jquery-ui.css" type="text/css">
<script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"></script>

Note that the temporary 'fix' is to click on the 'shield' icon in the top-left corner of the address bar and select 'Disable Protection on This Page', although this is not recommended for obvious reasons.

UPDATE: This link from the Firefox (Mozilla) support pages is also useful in explaining what constitutes mixed content and, as given in the above paragraph, does actually provide details of how to display the page regardless:

Most websites will continue to work normally without any action on your part.

If you need to allow the mixed content to be displayed, you can do that easily:

Click the shield icon Mixed Content Shield in the address bar and choose Disable Protection on This Page from the dropdown menu.

The icon in the address bar will change to an orange warning triangle Warning Identity Icon to remind you that insecure content is being displayed.

To revert the previous action (re-block mixed content), just reload the page.

Community
  • 1
  • 1
Appulus
  • 17,551
  • 10
  • 33
  • 43
  • 83
    A better approach would be to just remove the protocol entirely: `src="//code.jquery.com...`. The browser will use the protocol that the page was loaded with. – Blender Aug 15 '13 at 10:50
  • hmm, I have a site that has opened a new page without the address bar and then displays insecure content (fail, I know), how do you unblock mixed content in this scenario when the shield isn't available? – matao Sep 04 '13 at 06:58
  • +1 for this post, but I wish I could vote on the Firefox's team decision. Even great ideas can be implemented differently, and it's implementation that matters first, not the idea itself. – raina77ow Sep 10 '13 at 10:47
  • 18
    Oh man! The FF Dev Team shot themselves in the foot with this - cool idea, totally uncool implementation. No persistence for disabling pages, and no whitelist! (for when you know and trust a site with mixed content) – Raad Sep 13 '13 at 15:04
  • 7
    @Raad you simply cannot trust a site with mixed content. While site owners may be innocent, all the routers carrying http request may be not. I'd file a bug report to site owners. – alpha-mouse Oct 01 '13 at 12:48
  • Just ran into this too. It broke one of my Greasemonkey scripts... so not cool. Thanks for the explanation. – Radu Murzea Oct 01 '13 at 20:39
  • @alpha-mouse in principle, true; however there are 100s if not 1000s of sites that run on HTTPS but syndicate/include content from HTTP sites they have always deemed "safe and trusted". To suddenly break the browsing experience for those (without a persistent override) was, frankly, irresponsible. – Raad Oct 02 '13 at 11:13
  • 7
    @Raad and those hundreds if not thousands of sites are in the process exposing headers that might contain personally identifiable information meant to be encrypted with an SSL connection...frankly, I don't see the FF Dev Team as the irresponsible entity in this matter... – Assimilater Oct 03 '13 at 17:39
  • @Assimilater You're quite right, it is possible they are exposed, and in fact I'm all for greater security =) I'm not taking issue with FF **having** mixed-content blocking, but with the way in which it was (and to an extent, still is) implemented. As it was, people had no choice about what sites were blocked if they left the feature enabled. If you explicitly unblocked a site it would be blocked the next time you refreshed the page. If you were a developer having to work in mixed-mode it was very frustrating and you ended turning it off. Anyway, that's my point so I'll zip it now! – Raad Oct 04 '13 at 09:00
  • 3
    Extremely frustrating when it is blocking completely harmless actions. Speaking of zip! I have a plugin that uses Ziptastic to look up the city and state of the zip code you enter into an address form. This plugin is broken: all I want to do is use a restful API to grab a tiny JSON object -- no dice. This is the TSA of browser security! Let us have our pants back, for crap sake! – Chris Baker Oct 21 '13 at 20:01
  • In one MySQL instance, I had to do database update replacing all instances of `http` with `https` ie: `UPDATE YourTableName SET YourColumnName = REPLACE (YourColumnName, 'http', 'https')` – user1063287 Nov 26 '13 at 07:26
  • 1
    @user1063287 not a good idea because then any url's that were already `https` will now be `httpss`. better would have been `UPDATE YourTableName SET YourColumnName = REPLACE (YourColumnName, 'http:', '')` that way you'd be left with `//` which will use https (if viewed with https) – MonOve Jun 17 '16 at 02:42
  • 1
    The blog post content is also available in the link in the error message itself. Instead of a self answer I think you should consider marking Alain's solution as the answer. – Hack-R Oct 08 '16 at 23:17
145

It means you're calling http from https. You can use src="//url.to/script.js" in your script tag and it will auto-detect.

Alternately you can use use https in your src even if you will be publishing it to a http page. This will avoid the potential issue mentioned in the comments.

Hack-R
  • 19,705
  • 11
  • 63
  • 110
Alain Jacomet Forte
  • 4,275
  • 6
  • 25
  • 38
  • 1
    Just a note, if used on a locally stored webpage, it might cause the browser to search fruitlessly for the script, significantly delaying the loading of the page – binaryfunt Jul 24 '15 at 17:55
58

In absence of a white-list feature you have to make the "all" or "nothing" Choice. You can disable mixed content blocking completely.


The Nothing Choice

You will need to permanently disable mixed content blocking for the current active profile.

In the "Awesome Bar," type "about:config". If this is your first time you will get the "This might void your warranty!" message.

Yes you will be careful. Yes you promise!

Find security.mixed_content.block_active_content. Set its value to false.


The All Choice

iDevelApp's answer is awesome.

Community
  • 1
  • 1
DRaehal
  • 1,122
  • 9
  • 16
  • 1
    Do you know to enable mixed content on chrome? – Faizan May 10 '15 at 15:24
  • 1
    @Faizan: From [this answer](/a/24434461): "In the address bar at the right end should be a 'shield' icon, you can click on that to run insecure content." – fuglede Jul 06 '15 at 12:15
31

Put the below <meta> tag into the <head> section of your document to force the browser to replace unsecure connections (http) to secured connections (https). This can solve the mixed content problem if the connection is able to use https.

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

If you want to block then add the below tag into the <head> tag:

<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">
Christian Meyer
  • 816
  • 8
  • 14
tapas talukder
  • 579
  • 5
  • 4
13

If you are consuming an internal service via AJAX, make sure the url points to https, this cleared up the error for me.

Initial AJAX URL: "http://XXXXXX.com/Core.svc/" + ApiName
Corrected AJAX URL: "https://XXXXXX.com/Core.svc/" + ApiName,

12

Its given the error because of security. for this please use "https" not "http" in the website url.

For example :

   "https://code.jquery.com/ui/1.8.10/themes/smoothness/jquery-ui.css"
   "https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"
Amit Naraniwal
  • 1,120
  • 9
  • 11
11

In the relevant page which makes a mixed content https to http call which is not accessible we can add the following entry in the relevant and get rid of the mixed content error.

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
Jason Aller
  • 3,391
  • 28
  • 37
  • 36
sramay
  • 111
  • 1
  • 2
5

I had this same problem because I bought a CSS template and it grabbed a javascript an external javascript file through http://whatever.js.com/javascript.js. I went to that page in my browser and then changed it to https://whatever... using SSL and it worked, so in my HTML javascript tag I just changed the URL to use https instead of http and it worked.

bigpotato
  • 22,922
  • 46
  • 147
  • 286
4

To force redirect on https protocol, you can also add this directive in .htaccess on root folder

RewriteEngine on

RewriteCond %{REQUEST_SCHEME} =http

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Andrew Regan
  • 4,887
  • 6
  • 35
  • 67
3

@Blender Comment is the best approach. Never hard code the protocol anywhere in the code as it will be difficult to change if you move from http to https. Since you need to manually edit and update all the files.

This is always better as it automatically detect the protocol.

src="//code.jquery.com
Krishnadas PC
  • 3,966
  • 34
  • 33
3

Simply changing HTTP to HTTPS solved this issue for me.

WRONG :

<script src="http://code.jquery.com/jquery-3.5.1.js"></script>

CORRECT :

<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
2

I found if you have issues with including or mixing your page with something like http://www.example.com, you can fix that by putting //www.example.com instead

2

I have facing same problem when my site goes from http to https. We have added rule for all request to redirect http to https.

You needs to add the redirection rule for inter site request, but you have to remove the redirection rule for external js/css.

tapas talukder
  • 579
  • 5
  • 4
0

I just fixed this problem by adding the following code in header:

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

If your app server is weblogic, then make sure WLProxySSL ON entry exists(and also make sure it should not be commented) in the weblogic.conf file in webserver's conf directory. then restart web server, it will work.