Reputation: 41
I need to secure my Node Red with a CA signed certificate - not a self-signed certificate. I'm using a Amazon EC2 with Amazon Linux.
Upvotes: 2
Views: 4285
Reputation: 41
Resolved this myself.
For this to work porpoerly - you need a domain name for your Node red.
I used COMODO to get a SSL
Obtaining the CERT
mkdir sslcerts
cd sslcerts
openssl genrsa -out ./private.key 2048
openssl req -new -sha256 -key ./private.key -out ./{yourdomainname}.csr
$ cat COMODORSAAddTrustCA.crt COMODORSADomainValidationSecureServerCA.crt AddTrustExternalCARoot.crt > {yourdomainname}.ca-bundle. You need to copy both the ca-bundle file you just created AND the {yourdomainname}.crt file over to sslcerts on your server
Making the certificate usable by Node Red
nano settings.js
https: { ca: fs.readFileSync('sslcerts/{yourdomainname}.ca-bundle'), key: fs.readFileSync('sslcerts/private.key'), cert: fs.readFileSync('sslcerts/{yourdomainname}.crt') }
Upvotes: 2
Reputation: 1272
To add an SSL cert to Node Red, add the https key to settings.js:
...
},
https: {
key: fs.readFileSync('privkey.pem'),
cert: fs.readFileSync('cert.pem')
},
...
If you're asking how to obtain a CA signed certificate, there are many routes you can go. Look at Lets Encrypt for a free and automated solution.
Upvotes: 1