Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_SSL_PROTOCOL_ERROR #449

Closed
nitcheulegrand opened this issue Sep 24, 2018 · 15 comments
Closed

ERR_SSL_PROTOCOL_ERROR #449

nitcheulegrand opened this issue Sep 24, 2018 · 15 comments

Comments

@nitcheulegrand
Copy link

Hello
I am using PeerJS to implement a video conference web app.
I got this error while creating an instance of Peer object withought giving a key:
GET https://0.peerjs.com:9000/peerjs/id?ts=15377843943420.9081415662556815 net::ERR_SSL_PROTOCOL_ERROR

@kidandcat
Copy link
Member

Do you want to use SSL or not? if you dont use SSL, don't pass httpS.

If you want to use SSL, you will need to change the port (next week we will publish a new version with a fix).

So in the configuration options, pass:

{
  port: 443,
  host: "https://0.peerjs.com"
}

@nitcheulegrand
Copy link
Author

image
Screenshot of Chrome browser

@nitcheulegrand
Copy link
Author

let p = new Peer({ key: 'lwjd5qra8257b9', secure: true, initiator: true, stream: stream });

@nitcheulegrand
Copy link
Author

Let me do it as you say an come back to you.
Thank for assistancy.

@nitcheulegrand
Copy link
Author

nitcheulegrand commented Sep 24, 2018

The problem persist
let p = new Peer({ key: 'lwjd5qra8257b9', port: 443, host: "https://0.peerjs.com", secure: true, initiator: true, stream: stream });
@kidandcat You can check it yourself on this adresse https://legrandsoft.alwaysdata.net/

@kidandcat
Copy link
Member

Sorry: host: "0.peerjs.com"

PD: remove https://

@kidandcat
Copy link
Member

is it resolved?

@sonoiodc
Copy link

sonoiodc commented Apr 14, 2020

is it resolved?

Hi, I'm having the same problem, was it fixed?
I'm trying an unsecure connection without SSL; I even set the secure to false

@denis-trofimov
Copy link

denis-trofimov commented Apr 29, 2020

I have it too!

what I have
my_unsecure_peerjs_server:9000/peerjs/peerjs/id?ts=15881706796810.5981145912052981:1 Failed to load resource: net::ERR_SSL_PROTOCOL_ERROR peerjs.min.js:119 ERROR PeerJS: Error retrieving ID (TypeError) Failed to fetch

In JS I have no SSL references, but my domain sits on valid https URL.

var peer = new Peer({
  host: "my_unsecure_peerjs_server",
  port: 9000
})

Expected

my_unsecure_peerjs_server:9000/peerjs/peerjs/id in my Chrome browser gives me UUID seamlessly.

UPD solved

var peer = new Peer({
  host: "my_unsecure_peerjs_server",
  secure: false,
  port: 9000
})

now I need to solve Mixed Content: The page at 'https://my_secure_website/' was loaded over HTTPS, but requested an insecure resource 'http://my_unsecure_peerjs_server:9000/peerjs/peerjs/id?ts=15881726442920.8792690531482552'. This request has been blocked; the content must be served over HTTPS.

UPD 2 Really solved by now! I was wrong yesterday. Now the Mixed Content issue is solved, it require secure: true and both my web site and peerjs-server should be loaded over a secure HTTPS connection

var peer = new Peer({
  host: "my_peerjs_server_with_ssl_cert",
  secure: true,
  path: '/peerjs'
});

@javac0d3
Copy link

I do have a similar issue with Mixed content after setting the secure to false, the Id does not get delivered to client. Will keep posted if i find a solution, anybody else who did fix this can be of quick support to us.

@denis-trofimov
Copy link

denis-trofimov commented Apr 30, 2020

I do have a similar issue with Mixed content after setting the secure to false, the Id does not get delivered to client. Will keep posted if i find a solution, anybody else who did fix this can be of quick support to us.

I think it is OK to receive Mixed content error in my case, that is how SSL should work.

https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content
TL;DR Browsers may block mixed content altogether over time, in order to protect your site's users.

The only way I managed to solve it - put my peerjs-server behind reverse-proxy Nginx with SSL cert and solve trouble with headers (this Nginx proxy I don't control, my admin pal did it for me).

@denis-trofimov
Copy link

I do have a similar issue with Mixed content after setting the secure to false, the Id does not get delivered to client. Will keep posted if i find a solution, anybody else who did fix this can be of quick support to us.

Now the Mixed Content issue is solved, it require secure: true and both my web site and peerjs-server should be loaded over a secure HTTPS connection

var peer = new Peer({
  host: "my_peerjs_server_with_ssl_cert",
  secure: true,
  path: '/peerjs'
});

@javac0d3
Copy link

I had set this to true earlier, however i had a different issue which was related to certificate, I had pointed to a wrong certificate. By the way, i did install the turnserver on my localsystem and using the same instead of google. Anyways thanks for update. - Yeshwanth Hegde K

@javac0d3
Copy link

I do have a similar issue with Mixed content after setting the secure to false, the Id does not get delivered to client. Will keep posted if i find a solution, anybody else who did fix this can be of quick support to us.

Now the Mixed Content issue is solved, it require secure: true and both my web site and peerjs-server should be loaded over a secure HTTPS connection

var peer = new Peer({
  host: "my_peerjs_server_with_ssl_cert",
  secure: true,
  path: '/peerjs'
});

I did set the secure: true, however realised my issue was a bit different as i had pointed to a wrong certificate file once this was done got the issue solved. In the process I did went ahead and installed turnserver locally and now entire feature works without anyissue. Thanks for update. ,

@sugoireed
Copy link

You can host your own peerjs .js file on your server and start it using node peer.js. tha path can be /myapp and port 3000

Ensure you specify the sssl key and cert if your domain uses https. Then on your client side connect like this

        peer= new Peer({
                  host:'YOUR DOMAIN..XXXX.com',
                  key:'peerjs',
                  port:3000,
                  path:'/myapp',
                  debug:3,
                  secure:true,
                  config: { 'iceServers': [
                                  { url: 'stun:stun.l.google.com:19302' },
                                  { url: 'turn:numb.viagenie.ca:3478', credential: 'muazkh', username:'webrtc@live.com'},
                                  { url: 'turn:numb.viagenie.ca', credential: 'muazkh', username:'webrtc@live.com' },
                                  { url: 'turn:192.158.29.39:3478?transport=udp', credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=', username:'28224511:1379330808' },
                                  { url: 'turn:192.158.29.39:3478?transport=tcp', credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=', username:'28224511:1379330808' },
                                  { url: 'turn:13.250.13.83:3478?transport=udp', credential: 'YzYNCouZM1mhqhmseWk6=', username:'YzYNCouZM1mhqhmseWk6' }
        
                  ]
                }

  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants