From ac972b2c3be9368633573bcc726912f56b309f79 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 12 Aug 2016 15:24:28 -0600 Subject: [PATCH] add le-sni-auto --- index.js | 16 +++++++++++++++- package.json | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a59e93a..843978f 100644 --- a/index.js +++ b/index.js @@ -59,7 +59,7 @@ LE.create = function (le) { 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.core = require('./lib/core'); - // le.sni = require('le-sni-auto'); + le.sni = le.sni || require('le-sni-auto'); le = LE._undefine(le); le.acmeChallengePrefix = LE.acmeChallengePrefix; @@ -115,6 +115,20 @@ LE.create = function (le) { le[key] = le._challengeOpts[key]; } }); + + if (le.sni.create) { + le.sni = le.sni.create(le); + } + /* + le.sni = PromiseA.promisifyAll(le.sni); + le._sniOpts = le.sni.getOptions(); + Object.keys(le._sniOpts).forEach(function (key) { + if (!(key in le)) { + le[key] = le._sniOpts[key]; + } + }); + */ + // TODO wrap these here and now with tplCopy? if (5 !== le.challenge.set.length) { throw new Error("le.challenge.set receives the wrong number of arguments." diff --git a/package.json b/package.json index e83b3ee..009e923 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "homedir": "^0.6.0", "le-acme-core": "^2.0.5", "le-challenge-fs": "^2.0.2", + "le-sni-auto": "^2.0.1", "le-store-certbot": "^2.0.3", "node.extend": "^1.1.5", "pkijs": "^1.3.27",