Created
January 16, 2014 16:18
-
-
Save afuchs/8457813 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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