lets-encrypt-certificate-manager
v2.0.3
Published
Lets Encrypt certificate manager
Downloads
3
Readme
lets-encrypt-certificate-manager
dont use this package on production server
Lets Encrypt certificate manager encapsulates Greenlock and does auto renew Let's Encrypt certificates.
// create and manage certificate for a domain
const https = require('https');
const CertificateManager = require('lets-encrypt-certificate-manager');
CertificateManager.domain = 'www.example.com';
CertificateManager.email = '[email protected]';
CertificateManager.httpToHttpsRedirectEnabled = true; // redirects all traffic from http to https
CertificateManager.ip = '12.123.123.21';
//CertificateManager.version = 'draft-12'; // default is 'draft-12'
//CertificateManager.isProduction = true; // default is true
//CertificateManager.renewCertWithin = 60 * 24 * 60 * 60 * 1000; // default is 60 * 24 * 60 * 60 * 1000
//CertificateManager.renewCertBy = 30 * 24 * 60 * 60 * 1000; // default is 30 * 24 * 60 * 60 * 1000
//CertificateManager.debugEnabled = true; // default is true
var greenlock = CertificateManager.greenlockInit();
https.createServer(greenlock.httpsOptions, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);