0

I am trying to connect from a remote Chrome browser to my server (node server.js). The request is failing with an error:

"getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS."

This Chrome error is well documents. Newer versions of Chrome require https for this method to work.

So my questions is how to setup the server for https requests? I have set "https": true in the configuration file. I would really appreciate detail of how to create and install ssl cert and key for the houndify server. I am using the node.js.

BTW requests from localhost works perfectly.

Thanks, Shahriar

S. Vaghar
  • 191
  • 1
  • 1
  • 7

1 Answers1

0

You can find a useful info about setting up https server in node.js here: https://docs.nodejitsu.com/articles/HTTP/servers/how-to-create-a-HTTPS-server/.

Half of work is actually done in our example NodeJS server and you’ve correctly set https to true in config.json. You only need to generate “server.key” and “server.crt” files and put them in the same directory as server.js. If you want to use different location or filename, make sure you change values of sslKeyFile and sslCrtFile in config.json.

So for testing purposes you can generate self-signed certificate as opposed to 'Certificate Authority’-signed like this. Run following commands in the project's root directory:

openssl genrsa -out server.key
openssl req -new -key server.key -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey server.key -out server.crt
rm csr.pem
Tilo Mitra
  • 2,805
  • 1
  • 26
  • 20