Given an SSL key and certificate, how does one create an HTTPS service?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For Node 0.3.4 and above all the way up to the current LTS (v21 at the time of this edit), https://nodejs.org/api/https.html#httpscreateserveroptions-requestlistener has all the example code you need:
Note that if want to use Let’s Encrypt’s certificates using the certbot tool, the private key is called
privkey.pemand the certificate is calledfullchain.pem: