Compare commits
No commits in common. "f89f301a7c4427be15a9aec7ba51ac206a4372c2" and "ec5d2d326b2b0cfc7bb13d22066ac39544fd3266" have entirely different histories.
f89f301a7c
...
ec5d2d326b
48
index.js
48
index.js
|
@ -312,9 +312,6 @@ Greenlock.create = function (gl) {
|
||||||
if (!gl.approveDomains) {
|
if (!gl.approveDomains) {
|
||||||
gl.approvedDomains = gl.approvedDomains || [];
|
gl.approvedDomains = gl.approvedDomains || [];
|
||||||
gl.approveDomains = function (lexOpts, certs, cb) {
|
gl.approveDomains = function (lexOpts, certs, cb) {
|
||||||
var err;
|
|
||||||
var emsg;
|
|
||||||
|
|
||||||
if (!gl.email) {
|
if (!gl.email) {
|
||||||
throw new Error("le-sni-auto is not properly configured. Missing email");
|
throw new Error("le-sni-auto is not properly configured. Missing email");
|
||||||
}
|
}
|
||||||
|
@ -333,12 +330,8 @@ Greenlock.create = function (gl) {
|
||||||
lexOpts.communityMember = lexOpts.communityMember;
|
lexOpts.communityMember = lexOpts.communityMember;
|
||||||
return cb(null, { options: lexOpts, certs: certs });
|
return cb(null, { options: lexOpts, certs: certs });
|
||||||
}
|
}
|
||||||
|
log(gl.debug, 'unapproved domain', lexOpts.domains, gl.approvedDomains);
|
||||||
emsg = "tls SNI for '" + lexOpts.domains.join(',') + "' rejected: not in list '" + gl.approvedDomains + "'";
|
cb(new Error("unapproved domain"));
|
||||||
log(gl.debug, emsg, lexOpts.domains, gl.approvedDomains);
|
|
||||||
err = new Error(emsg);
|
|
||||||
err.code = 'E_REJECT_SNI';
|
|
||||||
cb(err);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,15 +343,7 @@ Greenlock.create = function (gl) {
|
||||||
try {
|
try {
|
||||||
gl.approveDomains(opts, certs, function (_err, results) {
|
gl.approveDomains(opts, certs, function (_err, results) {
|
||||||
if (_err) {
|
if (_err) {
|
||||||
if (false !== gl.logRejectedDomains) {
|
log(gl.debug, 'gl.approveDomains called with error', _err);
|
||||||
console.error("[Error] approveDomains rejected tls sni '" + domain + "'");
|
|
||||||
console.error("[Error] (see https://git.coolaj86.com/coolaj86/greenlock.js/issues/11)");
|
|
||||||
if ('E_REJECT_SNI' !== _err.code) {
|
|
||||||
console.error("[Error] This is the rejection message:");
|
|
||||||
console.error(_err.message);
|
|
||||||
}
|
|
||||||
console.error("");
|
|
||||||
}
|
|
||||||
cb(_err);
|
cb(_err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -366,30 +351,21 @@ Greenlock.create = function (gl) {
|
||||||
log(gl.debug, 'gl.approveDomains called with certs for', results.certs && results.certs.altnames || 'NONE', 'and options:');
|
log(gl.debug, 'gl.approveDomains called with certs for', results.certs && results.certs.altnames || 'NONE', 'and options:');
|
||||||
log(gl.debug, results.options);
|
log(gl.debug, results.options);
|
||||||
|
|
||||||
|
var promise;
|
||||||
|
|
||||||
if (results.certs) {
|
if (results.certs) {
|
||||||
log(gl.debug, 'gl renewing');
|
log(gl.debug, 'gl renewing');
|
||||||
return gl.core.certificates.renewAsync(results.options, results.certs).then(
|
promise = gl.core.certificates.renewAsync(results.options, results.certs);
|
||||||
function (certs) { cb(null, certs); }
|
|
||||||
, function (e) {
|
|
||||||
console.debug("Error renewing certificate for '" + domain + "':");
|
|
||||||
console.debug(e);
|
|
||||||
console.error("");
|
|
||||||
cb(e);
|
|
||||||
}
|
|
||||||
);;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log(gl.debug, 'gl getting from disk or registering new');
|
log(gl.debug, 'gl getting from disk or registering new');
|
||||||
return gl.core.certificates.getAsync(results.options).then(
|
promise = gl.core.certificates.getAsync(results.options);
|
||||||
function (certs) { cb(null, certs); }
|
}
|
||||||
, function (e) {
|
|
||||||
console.debug("Error loading/registering certificate for '" + domain + "':");
|
return promise.then(function (certs) { cb(null, certs); }, function (e) {
|
||||||
console.debug(e);
|
if (gl.debug) { console.debug("Error"); console.debug(e); }
|
||||||
console.error("");
|
|
||||||
cb(e);
|
cb(e);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.error("[ERROR] Something went wrong in approveDomains:");
|
console.error("[ERROR] Something went wrong in approveDomains:");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "greenlock",
|
"name": "greenlock",
|
||||||
"version": "2.2.16",
|
"version": "2.2.15",
|
||||||
"description": "Let's Encrypt for node.js on npm",
|
"description": "Let's Encrypt for node.js on npm",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in New Issue