Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 1. Generate SSL cert
// > openssl genrsa -out privatekey.pem 1024
// > openssl req -new -key privatekey.pem -out certrequest.csr
// > openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem
// 2. Set up your express server
var https = require('https');
var fs = require('fs');
var express = require('express');
var app = express();
var options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
https.createServer(options, app).listen(443);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.