andrao-https
v1.0.0
Published
letsencrypt-express wrapper
Readme
andrao-https
Letsencrypt SSL certificate renewal + http / https server initialization. letsencrypt-express wrapper.
Installation
npm install --save andrao-httpsUsage
var servers = require('andrao-https')(app, {
domains: ['github.com', 'www.github.com']
, email: '[email protected]'
});servers object contains native Node http and https listening at specified ports (default 80 for HTTP, 443 for HTTPS):
servers = {
http: [server@80]
https: [server@443]
}Options
Key | Description | Default
--- | --- | ---
domains | Certificate domains | []
email | Certificate email address | '[email protected]'
testing | Use staging server URL (for development) | false
http_ports | HTTP server port(s) | [80]
https_ports | HTTPS server port(s) | [443]
redirect | Automatic HTTP -> HTTPS redirect | true
Obtaining an SSL certificate via letsencrypt-cli
npm install -g letsencrypt-cliFor best results obtain cerificates individually for multiple domains, i.e. once for example.com, and once for www.example.com.
sudo letsencrypt certonly \
--agree-tos true --debug true --duplicate true \
--config-dir ~/letsencrypt/etc \
--email [email protected] \
--domains example.com \
--tls-sni-01-port HTTPS_PORT \
--http-01-port HTTP_PORT