Last active
November 6, 2024 11:48
-
Star
(177)
You must be signed in to star a gist -
Fork
(53)
You must be signed in to fork a gist
Revisions
-
davestevens revised this gist
Aug 8, 2016 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -53,8 +53,7 @@ Listen 443 server { listen 443 ssl; server_name example.com; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; } ``` -
davestevens revised this gist
Dec 5, 2015 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,8 @@ var fs = require('fs'); var options = { key: fs.readFileSync('/etc/letsencrypt/live/example.com/privkey.pem'), cert: fs.readFileSync('/etc/letsencrypt/live/example.com/cert.pem'), ca: fs.readFileSync('/etc/letsencrypt/live/example.com/chain.pem') }; https.createServer(options, function (req, res) { @@ -43,6 +44,7 @@ Listen 443 SSLEngine on SSLCertificateFile "/etc/letsencrypt/live/example.com/cert.pem" SSLCertificateKeyFile "/etc/letsencrypt/live/example.com/privkey.pem" SSLCertificateChainFile "/etc/letsencrypt/live/example.com/chain.pem" </VirtualHost> ``` @@ -53,5 +55,6 @@ server { server_name example.com; ssl_certificate /etc/letsencrypt/live/example.com/cert.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/example.com/fullchain.pem; } ``` -
davestevens revised this gist
Dec 3, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -35,7 +35,7 @@ https.createServer(options, function (req, res) { ``` ## Apache ```ApacheConf LoadModule ssl_module libexec/apache2/mod_ssl.so Listen 443 <VirtualHost *:443> @@ -47,7 +47,7 @@ Listen 443 ``` ## NGINX ```Nginx server { listen 443 ssl; server_name example.com; -
davestevens revised this gist
Dec 3, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Let's Encrypt Examples of getting certificates from [Let's Encrypt](https://letsencrypt.org/) working on Apache, NGINX and Node.js servers. ## Obtain certificates I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running -
davestevens created this gist
Dec 3, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,57 @@ # Let's Encrypt Examples of getting certificates from (Let's Encrypt)[https://letsencrypt.org/] working on Apache, NGINX and Node.js servers. ## Obtain certificates I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running ```shell git clone https://github.com/letsencrypt/letsencrypt cd letsencrypt ./letsencrypt-auto certonly --manual --email admin@example.com -d example.com ``` This creates a directory: `/etc/letsencrypt/live/example.com/` containing certificate files: - cert.pem - chain.pem - fullchain.pem - privkey.pem ## Node.js ```javascript var https = require('https'); var fs = require('fs'); var options = { key: fs.readFileSync('/etc/letsencrypt/live/example.com/privkey.pem'), cert: fs.readFileSync('/etc/letsencrypt/live/example.com/cert.pem') }; https.createServer(options, function (req, res) { res.writeHead(200); res.end("hello world\n"); }).listen(8000); ``` ## Apache ``` LoadModule ssl_module libexec/apache2/mod_ssl.so Listen 443 <VirtualHost *:443> ServerName example.com SSLEngine on SSLCertificateFile "/etc/letsencrypt/live/example.com/cert.pem" SSLCertificateKeyFile "/etc/letsencrypt/live/example.com/privkey.pem" </VirtualHost> ``` ## NGINX ``` server { listen 443 ssl; server_name example.com; ssl_certificate /etc/letsencrypt/live/example.com/cert.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; } ```