sammachin/node-red-contrib-ngrok

Tunnel a internal HTTPS-Website

Closed this issue · 2 comments

The new version works great. Thank you.

But one question.
I can start ngrok like this: ngrok http https://localhost:8443
This opens a tunnel to an internal HTTPS-Website. This works great.
How can I do this within node red?
Whitch options do I have to set?

Greetings
Thomas

Looks like this needs an update to the node to connect to https endpoints, although its not working in my testing right now, will get back to you.

Hi,

I've just publised 3.1.0 which may solve your issue,
There is now an HTTPS option in protocol which will behave the same as the command line agent, however there is currently an issue with the ngrok-javascript library that it doesn't like self-signed certs (as used by many internal webservers) So you may get ngrok error 3004 when trying to connect.
Apparently setting an env var of SSL_CERT_FILE with the servers CA.crt will sort this but I wasn't successful in my testing.
You can follow along at ngrok/ngrok-javascript#119

Additionally there is the TLS option, this works slightly differently to HTTPS in that ngrok does not terminal the SSL connection it simply uses the SNI field in the originating request. So the certificate from your internal server is sent to the end client for validation. This may work slightly better for your needs anyway.
The only drawback of this is that the URL returned by ngrok uses the prefix tls:// rather than https:// but simply changing that in the browser (or possibly on the output of the node) will resolve it.

I'm going to close this ticket for now, but if and when a fix for self signed certs is in the ngrok client it should just be picked up in the node too.