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
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.