Downloading a script from HTTP is automatically converted to HTTPS for some users

I am trying to load socket.io using the following code:

<script src="http://cdn.socket.io/socket.io-1.4.5.js"></script>

However, some users reported me the following error:

Failed to load https://cdn.socket.io/socket.io-1.4.5.js ERR_SSL_PROTOCOL_ERROR

Is this an automatic security setting in modern browsers? And if it can be disabled?

+4
source share
3 answers

The problem is not your mistake!

Access to this link in my browser also failed, and checking for an unsuccessful request shows that the following header was set:

Upgrade-Insecure-Requests: 1

This tells the browser to update all URLs http://to https://what seems to reflect the error your users are reporting.

ERR_SSL_PROTOCOL_ERROR , SSL https://cdn.socket.io/ , , , ( ) , , . "" , , , URL-.

- CDN, Chris Chen:

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js"></‌​script>
+3

, , , https- . - :

<script src="//cdn.socket.io/socket.io-1.4.5.js"></script>

<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>

( HTTP), .html .htm -.

+1

The link doesn't work at all. Is this a private link requiring certification?

If you just want socket.io.js, use the link from https://cdnjs.com/libraries/socket.io

0
source

Source: https://habr.com/ru/post/1671098/


All Articles