Created
June 3, 2014 00:59
-
-
Save startswithaj/a5c7289da0590a480a3b to your computer and use it in GitHub Desktop.
Generate ssl cert for localhost use with express
This file contains 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
Commands: | |
openssl genrsa -des3 -out server.key 1024 | |
openssl req -new -key server.key -out server.csr | |
>>>>>Common Name (eg, YOUR name) []:localhost | |
openssl x509 -req -days 1024 -in server.csr -signkey server.key -out server.crt | |
Express: | |
privateKey = fs.readFileSync('/Users/jake/webclient/server.key').toString(); | |
certificate = fs.readFileSync('/Users/jake/webclient/server.crt').toString(); | |
credentials = {key: privateKey, cert: certificate}; | |
server = https.createServer(credentials, app).listen(config.listenPort) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment