0

1.how to generate privatekey.pem and certificate.pem files using nodejs server in windows application?

var privateKey = fs.readFileSync( 'privatekey.pem' );
var certificate = fs.readFileSync( 'certificate.pem' );

https.createServer({
    key: privateKey,
    cert: certificate
}, app).listen(port);
  • Try this answer in http://stackoverflow.com/questions/12871565/how-to-create-pem-files-for-https-web-server – Kalana Demel Apr 20 '17 at 14:51
  • Possible duplicate of [How to create .pem files for https web server](http://stackoverflow.com/questions/12871565/how-to-create-pem-files-for-https-web-server) – Kalana Demel Apr 20 '17 at 14:52

1 Answers1

0

If you want to use nodejs try this module which can generate keys and self-signed certs, you will need to install openssl as a prerequisite. Alternatively just install openssl and use directly from command line, finally you can check out letsencrypt.

simon-p-r
  • 3,623
  • 2
  • 20
  • 35