Console errors. Failed to load resource: net::ERR_

2020-01-27 20:16发布

问题:

I'm getting them on my links in my head.

GET https://fr.s.us/js/jquery-ui.css net::ERR_INSECURE_RESPONSE

GET https://fr.s.us/js/jquery-1.9.1.min.js net::ERR_INSECURE_RESPONSE

GET https://fr.s.us/js/jquery-ui.js net::ERR_INSECURE_RESPONSE

Someone please enlighten me on these jquery console errors..

Failed to load resource: net::ERR_INSECURE_RESPONSE 

回答1:

I am assuming you're using Chrome.

If so, the root problem is a certificate mismatch / expired certificate.

You can see this for yourself in the code here.

Note in particular the use of the very constant you reference in the code on line 48 of the C++ file I sent you:

 case net::ERR_INSECURE_RESPONSE:

The current version of this file is here. The error status ERR_INSECURE_RESPONSE may not any longer be on line 48 but the error code still exists in the SSL certificate portion of the code.

Note: Make sure to use the hostname which is listed in the SSL certificate, chrome automatically switches to the right hostname if you are browsing but not when using javascript.



回答2:

The supplied host is not resolving for me (custom DNS or self configured host?) so I can only hazard to guess.

But as you are requesting the resources over SSL it is likely the certificate is invalid. Either it is self-signed and has not been added to your browser/OS exceptions or it is otherwise invalid.

Try the URI directly in the same browser and inspect the certificate.

Edit: this is in no way related to jQuery, JavaScript or CSS directly.



回答3:

I had this problem with chrome when I was working on a WordPress site. I added this code

$_SERVER['HTTPS'] = false;

into the theme's functions.php file - it asks you to log in again when you save the file but once it's logged in it works straight away.



回答4:

This can also happen if you have Chrome update automatically. Open Check chrome://help. The status should be:

Google Chrome is up to date.

Sometimes the status is requesting for a Chrome restart. In this case I had similar issues with several resources failing to load due to net::ERR_INSECURE_RESPONSE. After restarting Chrome, everything worked normally.



回答5:

When I had the problem recently it was a cross site issue where our dev server hosts our analytics software as well as the application. In the other environments the chrome console would show this error and the javascript file (tracker) on the dev server as the source. This was causing issues for QA personnel who were trying to view the analytics data for their environment (nothing was being captured because of this issue).

The solution to fix this in-house was to add the SSL certificate the DEV site was using to the Trusted People store on the QA people's machine.

If this was a problem in production I would most likely move the javascript into the actual web apps.



回答6:

Try to open it in an incognito window. I hope this will help. Alternatively, you could modify application/.htaccess like so:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]


回答7:

Learn about CORS, try crossorigin.me is work fine

Example: https://crossorigin.me/https://fr.s.us/js/jquery-ui.css

Not show a message error and continue page white, u need see error is try

http://cors.io/?u=https://fr.s.us/js/jquery-ui.css

enjoin us ;-)



回答8:

For me the problem was the <base href="https://domain.ext/"> tag.

After removing, it was OK. Cannot really understand why it was a problem.



回答9:

You are trying to get data from an https that does not have certificate. Change "https://" to "http://". Worked for me.



回答10:

In my case, sometimes when i tests my MVC project by a localhost https url (E.g. https://localhost:44373/), the Chrome raise this error: net::ERR_INSECURE_RESPONSE for the website resources (such as JS files).

So i resolve it by Clear Cache. Then i refresh the page and Chrome show me a special page about insecure url and i just allow it by click on Proceed to localhost (unsafe).



回答11:

It was on Chrome for Android in my case. All the static files served from a CDN with a CNAME that's SSL encrypted were not showing up. On Chrome desktop, it all showed fine.

Broken SSL cert

When I properly added the certs in ca_bundle the files displayed correctly.

Chrome for Android takes encryption seriously unlike Desktop. I hope this saves you time and stress



回答12:

If you use chrome, you can make a shortcut,right click and edit the shortcut's target, append this after target's string:

--ignore-certificate-errors

The complete string looks like this:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --ignore-certificate-errors


回答13:

Encode and make it like this: $_GET[].