I have generated a self-signed certificate and I am using it with Node.js with
const httpsOptions = {
key: fs.readFileSync('./key.pem'),
cert: fs.readFileSync('./cert.pem')
};
const server = https.createServer(httpsOptions, app).listen(app.get('port'), () => {
console.log('Server listening on port %d in %s mode', app.get('port'), app.get('env'));
});
I am able to access https://localhost:3000, but Chrome says that the url is 'Not Secure'. I have tried to make Chrome trust the certificate by first adding the certificate to Keychain Access in Mac OSX and then clicking it to say "Always Trust" in "When using this certificate", but it keeps saying that the URL is not secure.
Edit
I have followed many different tutorials to make Chrome trust my self-signed certificate.
I have added the certificate in Keychain Access (both to login
and System
). I have updated the certificate to tell the OS to always trust the certificate.
I have restarted my computer, Chrome, and Node.js server, but it still says that the connection is not secure.
I have no idea what I have done wrong.
Edit 2
It says that the certificate is trusted, so it might be configured wrong.