Can't connect to webrtc-star with ssl

I’m using this configuration with NGINX. I have my host name in an environment variable, but you can just hard code it in there if it makes your life easier. Replace ${DNSHOSTNAME} with your domain name and change 5892 to whatever port you’re running webrtc-star on. You will have to have a legitimate SSL certificate (using e.g. letsencrypt) that matches your domain name. I don’t think there’s any way you will get your browser to connect over wss with a self-signed cert. If you do figure out a way to do that, please let me know…

upstream websocket {
server ${DNSHOSTNAME}:5892;
}

server {
listen 8443 ssl;
server_name ${DNSHOSTNAME};
ssl_certificate /etc/nginx/certs/certbundled.crt;
ssl_certificate_key /etc/nginx/certs/private.key;

location /p2p {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade ‘Websocket’;
proxy_set_header Connection ‘Upgrade’;
proxy_set_header Host ${DNSHOSTNAME};
}
}

1 Like