I followed the tutorial below to create a https server https://docs.nodejitsu.com/articles/HTTP/servers/how-to-create-a-HTTPS-server/
and the program runs without errors
I use Caddyserver with config like this:
:443 tls self_signed