paritytech / substrate-telemetry

Polkadot Telemetry service
GNU General Public License v3.0
299 stars 208 forks source link

Problem with HTTPS #499

Closed Sr20dem closed 1 year ago

Sr20dem commented 1 year ago

Hello. I want to run telemetry on my own domain wth https https://telemetry.sr20de.online. I configured nginx, here is the configuration file:

server
        {
        listen 80;

server_name telemetry.sr20de.online www.telemetry.sr20de.online;
        charset utf-8;
        root /var/www/telemetry_sr20de;
        index index.html index.htm;
        }
server
        {
        listen 443 ssl;
        ssl_certificate /etc/ssl/certificate2.crt;
        ssl_certificate_key /etc/ssl/private2.key;

server_name telemetry.sr20de.online www.telemetry.sr20de.online;
        charset utf-8;
        root /var/www/telemetry_sr20de;
        index index.html index.htm;
        }

If I run the node using the ws protocol (--telemetry-url 'ws://telemetry.sr20de.online:8001/submit 0'), then everything works fine. The site opens at http://telemetry.sr20de.online

But if I run a node on wss (--telemetry-url 'wss://telemetry.sr20de.online:8001/submit 0'), I get an error:

Error while dialing /dns/telemetry.sr20de.online/tcp/8001/x-parity-wss/%2Fsubmit: Custom { kind: Other, error: Other(A(Tls(Io(Custom { kind: InvalidData, error: CorruptMessage })))) }

The site on https also shows the error https://telemetry.sr20de.online:

WebSocket connection to 'wss://telemetry.sr20de.online/feed/' failed

What to do? Maybe I configured ngnx incorrectly?

jsdw commented 1 year ago

This is an nginx issue indeed; youy need to proxy connections through from nginx to telemetry, so that nginx deals with all of the tls stuff and telemetry just gets unencrypted http/ws connections.

I'd suggest checking out the proxy_pass stuff in nginx, but offhand I don't have anything good to point you at so you'll have to do a bit of googling I'm afraid!

I'll close this for now as it's not a telemetry issue :)