diff --git a/lib/sni-callback.js b/lib/sni-callback.js index fa78034..1afef6f 100644 --- a/lib/sni-callback.js +++ b/lib/sni-callback.js @@ -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 + "':");