Compare commits

..

2 Commits

Author SHA1 Message Date
621e04ffe6 v1.5.3: merge fix for #11 2019-03-14 12:15:08 -06:00
f0f9feb519 #11 skip challenge when valid 2019-02-04 23:04:24 -07:00
2 changed files with 13 additions and 1 deletions

12
node.js
View File

@ -148,6 +148,7 @@ ACME._registerAccount = function (me, options) {
, contact: contact , contact: contact
}; };
if (options.externalAccount) { if (options.externalAccount) {
// TODO is this really done by HMAC or is it arbitrary?
body.externalAccountBinding = me.RSA.signJws( body.externalAccountBinding = me.RSA.signJws(
options.externalAccount.secret options.externalAccount.secret
, undefined , undefined
@ -637,6 +638,13 @@ ACME._getCertificate = function (me, options) {
return results.challenges.some(function (ch) { return results.challenges.some(function (ch) {
return ch.type === chType; return ch.type === chType;
}); });
}).sort(function (aType, bType) {
var a = results.challenges.filter(function (ch) { return ch.type === aType; })[0];
var b = results.challenges.filter(function (ch) { return ch.type === bType; })[0];
if ('valid' === a.status) { return 1; }
if ('valid' === b.status) { return -1; }
return 0;
})[0]; })[0];
var challenge = results.challenges.filter(function (ch) { var challenge = results.challenges.filter(function (ch) {
@ -651,6 +659,10 @@ ACME._getCertificate = function (me, options) {
)); ));
} }
if ("valid" === challenge.status) {
return;
}
return ACME._postChallenge(me, options, results.identifier, challenge); return ACME._postChallenge(me, options, results.identifier, challenge);
}).then(function () { }).then(function () {
return next(); return next();

View File

@ -1,6 +1,6 @@
{ {
"name": "acme-v2", "name": "acme-v2",
"version": "1.5.2", "version": "1.5.3",
"description": "Free SSL. A framework for building Let's Encrypt v2 clients, and other ACME v2 (draft 11) clients. Successor to le-acme-core.js", "description": "Free SSL. A framework for building Let's Encrypt v2 clients, and other ACME v2 (draft 11) clients. Successor to le-acme-core.js",
"homepage": "https://git.coolaj86.com/coolaj86/acme-v2.js", "homepage": "https://git.coolaj86.com/coolaj86/acme-v2.js",
"main": "node.js", "main": "node.js",