0

I was running substrate node template with non secure ws connection . After integrating with pallet-evm,pallet-ethereum and other precompiles , I wanted to connect to metamask with secure rpc connection (https) but all i get was http rpc connection and ws connection for interacting with polkadot explorer . So is there a way to connect to polkadot explorer with wss connection and metamask with https rpc connection

1 Answer 1

1

You have to proxy it behind a proxy-ing webserver (for example nginx) since the node itself cannot provide a valid certificate. More info can be found on the polkadot wiki. For nginx you can add the following (in an ssl enabled virtal host), assuming the node rpc port is 9944:

server {   
    (...)   
    location / {
    proxy_buffers 16 4k;
    proxy_buffer_size 2k;
    proxy_pass http://localhost:9944;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;    
    } 
 }
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.