add crl option

This commit is contained in:
AJ ONeal 2016-04-16 09:20:24 -06:00
parent f884f5cc58
commit d27452bb58
1 changed files with 4 additions and 3 deletions

View File

@ -25,7 +25,7 @@ module.exports.create = function (opts) {
return v;
},' '));
}
if (!opts.letsencrypt) { throw new Error("requires opts.letsencrypt to be a letsencrypt instance"); }
if (!opts.lifetime) { opts.lifetime = 90 * 24 * 60 * 60 * 1000; }
@ -103,6 +103,7 @@ module.exports.create = function (opts) {
key: certInfo.privkey || certInfo.key // privkey.pem
, cert: certInfo.fullchain || certInfo.cert // fullchain.pem (cert.pem + '\n' + chain.pem)
, ca: (opts.httpsOptions.ca ? opts.httpsOptions.ca + '\n' + certInfo.ca : certInfo.ca)
, crl: opts.httpsOptions.crl
});
} catch(e) {
console.warn("[Sanity Check Fail]: a weird object was passed back through le.fetch to lex.fetch");
@ -127,7 +128,7 @@ module.exports.create = function (opts) {
if (opts.debug) {
console.debug("[LEX] '" + hostname + "' is not registered, requesting approval");
}
if (!hostname) {
sniCb(new Error('[registerCert] no hostname'));
return;
@ -167,7 +168,7 @@ module.exports.create = function (opts) {
sniCb(new Error('[sniCallback] [fetch] no hostname'));
return;
}
opts.letsencrypt.fetch({ domains: [hostname] }, function (err, certInfo) {
if (opts.debug) {
console.debug("[LEX] fetch from disk result '" + hostname + "':");