Reputation: 12054
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 ?
Upvotes: 3
Views: 2191
Reputation: 409
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/.
Upvotes: 1
Reputation: 543
Pls. note, that Let's Encrypt certificates, created over the Plesk Let's Encrypt extension, place their original certificate files at:
/usr/local/psa/var/modules/letsencrypt/etc/live/(sub)YOUR-DOMAIN.COM
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. ;-)
Upvotes: 3
Reputation: 10312
For example you have domain example.tld
with Let's Encrypt certificate name Lets 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:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa -e "select id, cert_file, ca_file, name from certificates where name like '%example%'"
+----+-------------+-------------+----------------------------------------------+
| id | cert_file | ca_file | name |
+----+-------------+-------------+----------------------------------------------+
| 3 | cert-1lPfuj | cert-6oXdCf | Lets Encrypt example.tld |
+----+-------------+-------------+----------------------------------------------+
and as @El_Matella said check files cert-1lPfuj
and cert-6oXdCf
at /usr/local/psa/var/certificates
:
# ls -la /usr/local/psa/var/certificates/cert-*
-r--------. 1 root root 5050 Jan 1 02:33 /usr/local/psa/var/certificates/cert-1lPfuj
-r--------. 1 root root 1635 Jan 1 02:33 /usr/local/psa/var/certificates/cert-6oXdCf
Upvotes: 0