aliased httpsOptions as tlsOptions for issue #78

This commit is contained in:
tigerbot 2017-04-10 14:41:54 -06:00
parent 3a1324f464
commit 72dfb01e5e
1 changed files with 9 additions and 17 deletions

View File

@ -42,7 +42,7 @@ LE._undefined = {
, challenge: u , challenge: u
, challenges: u , challenges: u
, sni: u , sni: u
, httpsOptions: u , tlsOptions: u
, register: u , register: u
, check: u , check: u
@ -194,10 +194,8 @@ LE.create = function (le) {
}); });
le.sni = le.sni || null; le.sni = le.sni || null;
if (!le.httpsOptions) { le.tlsOptions = le.tlsOptions || le.httpsOptions || {};
le.httpsOptions = {}; if (!le.tlsOptions.SNICallback) {
}
if (!le.httpsOptions.SNICallback) {
if (!le.getCertificatesAsync && !le.getCertificates) { if (!le.getCertificatesAsync && !le.getCertificates) {
if (Array.isArray(le.approveDomains)) { if (Array.isArray(le.approveDomains)) {
le.approvedDomains = le.approveDomains; le.approvedDomains = le.approveDomains;
@ -256,20 +254,14 @@ LE.create = function (le) {
if (le.sni.create) { if (le.sni.create) {
le.sni = le.sni.create(le); le.sni = le.sni.create(le);
} }
le.httpsOptions.SNICallback = le.sni.sniCallback; le.tlsOptions.SNICallback = le.sni.sniCallback;
} }
if (!le.httpsOptions.key || !le.httpsOptions.cert) { if (!le.tlsOptions.key || !le.tlsOptions.cert) {
le.httpsOptions = require('localhost.daplie.me-certificates').merge(le.httpsOptions); le.tlsOptions = require('localhost.daplie.me-certificates').merge(le.tlsOptions);
} }
/* // We want to move to using tlsOptions instead of httpsOptions, but we also need to make
le.sni = PromiseA.promisifyAll(le.sni); // sure anything that uses this object will still work if looking for httpsOptions.
le._sniOpts = le.sni.getOptions(); le.httpsOptions = le.tlsOptions;
Object.keys(le._sniOpts).forEach(function (key) {
if (!(key in le)) {
le[key] = le._sniOpts[key];
}
});
*/
if (le.core.create) { if (le.core.create) {
le.core = le.core.create(le); le.core = le.core.create(le);