0

This is how I generate a self-signed certificate, following this guide:

$ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem

In my code, in bin/www:

 var options = {
  key: fs.readFileSync('ssl/key.pem'),
  cert: fs.readFileSync('ssl/cert.pem'),
  passphrase: 'xxxx'
};

I will get a warning on Chrome:

Your connection is not private

enter image description here

If I use it over an iframe:

<iframe src="https://127.0.1.1:3030/" width="100%" height="900" frameborder="1"></iframe>

Then I will get this error on Chrome:

GET https://127.0.1.1:3030/ net::ERR_INSECURE_RESPONSE

How can I create the certificate properly without having these warning and error?

Notes:

There is accepted answer from that suggestion.Also most of the answers are for Windows. I am on Linux/ Ubuntu/ Arch.

Run
  • 54,938
  • 169
  • 450
  • 748
  • Does the certificate include the port 3030 for the domain? – hjpotter92 Mar 30 '17 at 13:12
  • Check this post, http://stackoverflow.com/questions/8169999/how-can-i-create-a-self-signed-cert-for-localhost – Gaurav Gandhi Mar 30 '17 at 13:12
  • Possible duplicate of [How can I create a self-signed cert for localhost?](http://stackoverflow.com/questions/8169999/how-can-i-create-a-self-signed-cert-for-localhost) – Gaurav Gandhi Mar 30 '17 at 13:12
  • @hjpotter92 should I include the port 3030 in? the process never ask me to put in the address when creating the cert at all. – Run Mar 30 '17 at 13:27

0 Answers0