My client’s websites runs a ssl generated by PLESK.
I used to run node.js with SSL thanks to:
var ssl = {
key: fs.readFileSync('/etc/letsencrypt/live/mysite.com/privkey.pem'),
cert: fs.readFileSync('/etc/letsencrypt/live/mysite/cert.pem')
};
But I have no idea where PLESK did create these 2 files.
I tried with:
> /etc/ssl/certs/ssl-cert-snakeoil.pem
> /etc/ssl/private/ssl-cert-snakeoil.key
With no success.
Any idea on how to run nodejs with SSL generated by Plesk ?
3
Answers
For example you have domain
example.tld
with Let’s Encrypt certificate nameLets Encrypt example.tld
. You can download certificate file with private key from Plesk UI:Or you may try to find this certificate files by following request:
and as @El_Matella said check files
cert-1lPfuj
andcert-6oXdCf
at/usr/local/psa/var/certificates
:Pls. note, that Let’s Encrypt certificates, created over the Plesk Let’s Encrypt extension, place their original certificate files at:
… while these files are symlinks to the archive of all created Let’s Encrypt certificates and these symlinks will always link to the latest ( and actual valid ) certifiate files ( pls. remember, that Let’s Encrypt certificates are only valid for a maximum of 90 days! ).
In addition, pls. note as well, that you should use the “fullchain.pem” and not the “cert.pem”, because the “cert.pem” misses the needed root certificate. 😉
I would recommend to use the NodeJS extension for Plesk (version Onyx) and the LetsEncrypt Extension to handle the verification, routing and automatic renewal of your Certificates. That Way you can to everything in the Plesk web interface and don’t even have to use the console.
process.env.PORT
For more Details check out the Tutorial by Plesk:
https://www.plesk.com/blog/product-technology/node-js-plesk-onyx/.