I create certificates using the following commands:
I use localhost as the common-name for the second command
openssl genrsa -out node-key.pem 2048
openssl req -new -sha256 -key node-key.pem -out node-csr.pem
openssl x509 -req -in node-csr.pem -signkey node-key.pem -out node-cert.pem
and modify my settings as
requireHttps: false,
https: {
key: fs.readFileSync('./certs/node-key.pem'),
cert: fs.readFileSync('./certs/node-cert.pem'),
ca: fs.readFileSync('./certs/node-csr.pem')
},
I start node-red
// Create a server
let server = http.createServer(app);
// Initialise the runtime with a server and settings
RED.init(server, settings);
// Serve the editor UI from /red
app.use(settings.httpAdminRoot, RED.httpAdmin)
// Serve the http nodes UI from /api
app.use(settings.httpNodeRoot, RED.httpNode)
server.listen(1880, async (error) => {
// Start the runtime
await RED.start()
})
Then hit the url: https://localhost:1880/red/
And face the error:
ERR_SSL_PROTOCOL_ERROR
What am I doing wrong?