add le.httpsOptions with le.sni.sniCallback

This commit is contained in:
AJ ONeal 2016-08-15 14:36:58 -06:00
parent d7ea101ae9
commit bb211e8f42
1 changed files with 13 additions and 3 deletions

View File

@ -59,7 +59,6 @@ LE.create = function (le) {
le.store = le.store || require('le-store-certbot').create({ debug: le.debug }); le.store = le.store || require('le-store-certbot').create({ debug: le.debug });
le.challenge = le.challenge || require('le-challenge-fs').create({ debug: le.debug }); le.challenge = le.challenge || require('le-challenge-fs').create({ debug: le.debug });
le.core = require('./lib/core'); le.core = require('./lib/core');
le.sni = le.sni || require('le-sni-auto');
le = LE._undefine(le); le = LE._undefine(le);
le.acmeChallengePrefix = LE.acmeChallengePrefix; le.acmeChallengePrefix = LE.acmeChallengePrefix;
@ -118,8 +117,19 @@ LE.create = function (le) {
} }
}); });
if (le.sni.create) { le.sni = le.sni || null;
le.sni = le.sni.create(le); if (!le.httpsOptions) {
le.httpsOptions = {};
}
if (!le.httpsOptions.SNICallback) {
le.sni = le.sni || require('le-sni-auto');
if (le.sni.create) {
le.sni = le.sni.create(le);
}
le.httpsOptions.SNICallback = le.sni.sniCallback;
}
if (!le.httpsOptions.key || !le.httpsOptions.cert) {
le.httpsOptions = require('localhost.daplie.com-certificates').merge(le.httpsOptions);
} }
/* /*
le.sni = PromiseA.promisifyAll(le.sni); le.sni = PromiseA.promisifyAll(le.sni);