v1.7.6: add http-01 url to challenge
This commit is contained in:
parent
de9afbbab9
commit
48c6f842b4
16
node.js
16
node.js
|
@ -378,20 +378,28 @@ ACME._challengeToAuth = function (me, options, request, challenge, dryrun) {
|
||||||
// { type, status, url, token }
|
// { type, status, url, token }
|
||||||
// (note the duplicate status overwrites the one above, but they should be the same)
|
// (note the duplicate status overwrites the one above, but they should be the same)
|
||||||
Object.keys(challenge).forEach(function (key) {
|
Object.keys(challenge).forEach(function (key) {
|
||||||
auth[key] = challenge[key];
|
// don't confused devs with the id url
|
||||||
|
if ('url' === key) {
|
||||||
|
//auth.uri = challenge.url;
|
||||||
|
} else {
|
||||||
|
auth[key] = challenge[key];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// batteries-included helpers
|
// batteries-included helpers
|
||||||
auth.hostname = request.identifier.value;
|
auth.hostname = auth.identifier.value;
|
||||||
|
// because I'm not 100% clear if the wildcard identifier does or doesn't have the leading *. in all cases
|
||||||
|
auth.altname = ACME._untame(auth.identifier.value, auth.wildcard);
|
||||||
auth.thumbprint = me.RSA.thumbprint(options.accountKeypair);
|
auth.thumbprint = me.RSA.thumbprint(options.accountKeypair);
|
||||||
// keyAuthorization = token || '.' || base64url(JWK_Thumbprint(accountKey))
|
// keyAuthorization = token || '.' || base64url(JWK_Thumbprint(accountKey))
|
||||||
auth.keyAuthorization = challenge.token + '.' + auth.thumbprint;
|
auth.keyAuthorization = challenge.token + '.' + auth.thumbprint;
|
||||||
|
// conflicts with ACME challenge id url, if we ever decide to use it, but this just makes sense
|
||||||
|
// (as opposed to httpUrl or challengeUrl or uri, etc - I'd be happier to call the id url a uri)
|
||||||
|
auth.url = 'http://' + auth.identifier.value + ACME.challengePrefixes['http-01'] + '/' + auth.token;
|
||||||
auth.dnsHost = dnsPrefix + '.' + auth.hostname.replace('*.', '');
|
auth.dnsHost = dnsPrefix + '.' + auth.hostname.replace('*.', '');
|
||||||
auth.dnsAuthorization = ACME._toWebsafeBase64(
|
auth.dnsAuthorization = ACME._toWebsafeBase64(
|
||||||
require('crypto').createHash('sha256').update(auth.keyAuthorization).digest('base64')
|
require('crypto').createHash('sha256').update(auth.keyAuthorization).digest('base64')
|
||||||
);
|
);
|
||||||
// because I'm not 100% clear if the wildcard identifier does or doesn't have the leading *. in all cases
|
|
||||||
auth.altname = ACME._untame(request.identifier.value, request.wildcard);
|
|
||||||
|
|
||||||
return auth;
|
return auth;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
{
|
{
|
||||||
"name": "acme-v2",
|
"name": "acme-v2",
|
||||||
"version": "1.5.3",
|
"version": "1.7.6",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coolaj86/urequest": {
|
"@coolaj86/urequest": {
|
||||||
"version": "1.3.6",
|
"version": "1.3.7",
|
||||||
"resolved": "https://registry.npmjs.org/@coolaj86/urequest/-/urequest-1.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/@coolaj86/urequest/-/urequest-1.3.7.tgz",
|
||||||
"integrity": "sha512-9rBXLFSb5D19opGeXdD/WuiFJsA4Pk2r8VUGEAeUZUxB1a2zB47K85BKAx3Gy9i4nZwg22ejlJA+q9DVrpQlbA=="
|
"integrity": "sha512-PPrVYra9aWvZjSCKl/x1pJ9ZpXda1652oJrPBYy5rQumJJMkmTBN3ux+sK2xAUwVvv2wnewDlaQaHLxLwSHnIA=="
|
||||||
},
|
},
|
||||||
"eckles": {
|
"eckles": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "acme-v2",
|
"name": "acme-v2",
|
||||||
"version": "1.7.5",
|
"version": "1.7.6",
|
||||||
"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",
|
||||||
|
|
Loading…
Reference in New Issue