fix(buypass): correct Accept header for pem certs
This commit is contained in:
parent
45fd6962f2
commit
11732d72b4
6
acme.js
6
acme.js
|
@ -1055,9 +1055,7 @@ ACME._pollOrderStatus = function (me, options, kid, order, verifieds) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('invalid' === resp.body.status) {
|
if ('invalid' === resp.body.status) {
|
||||||
return Promise.reject(
|
return Promise.reject(E.ORDER_INVALID(options, verifieds, resp));
|
||||||
E.ORDER_INVALID(options, verifieds, resp)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('ready' === resp.body.status) {
|
if ('ready' === resp.body.status) {
|
||||||
|
@ -1102,7 +1100,7 @@ ACME._redeemCert = function (me, options, kid, voucher) {
|
||||||
url: voucher._certificateUrl,
|
url: voucher._certificateUrl,
|
||||||
protected: { kid: kid },
|
protected: { kid: kid },
|
||||||
payload: Enc.binToBuf(''),
|
payload: Enc.binToBuf(''),
|
||||||
json: true
|
headers: { Accept: 'application/pem-certificate-chain' }
|
||||||
}).then(function (resp) {
|
}).then(function (resp) {
|
||||||
//#console.debug('ACME.js: csr submitted and cert received:');
|
//#console.debug('ACME.js: csr submitted and cert received:');
|
||||||
|
|
||||||
|
|
4
utils.js
4
utils.js
|
@ -28,7 +28,7 @@ U._jwsRequest = function (me, bigopts) {
|
||||||
.then(function (jws) {
|
.then(function (jws) {
|
||||||
//#console.debug('[ACME.js] url: ' + bigopts.url + ':');
|
//#console.debug('[ACME.js] url: ' + bigopts.url + ':');
|
||||||
//#console.debug(jws);
|
//#console.debug(jws);
|
||||||
return U._request(me, { url: bigopts.url, json: jws });
|
return U._request(me, { url: bigopts.url, json: jws, headers: bigopts.headers });
|
||||||
})
|
})
|
||||||
.catch(function (e) {
|
.catch(function (e) {
|
||||||
if (/badNonce$/.test(e.urn)) {
|
if (/badNonce$/.test(e.urn)) {
|
||||||
|
@ -84,7 +84,9 @@ U._request = function (me, opts) {
|
||||||
opts.headers['User-Agent'] = ua;
|
opts.headers['User-Agent'] = ua;
|
||||||
}
|
}
|
||||||
if (opts.json) {
|
if (opts.json) {
|
||||||
|
if (!opts.headers.Accept) {
|
||||||
opts.headers.Accept = 'application/json';
|
opts.headers.Accept = 'application/json';
|
||||||
|
}
|
||||||
if (true !== opts.json) {
|
if (true !== opts.json) {
|
||||||
opts.body = JSON.stringify(opts.json);
|
opts.body = JSON.stringify(opts.json);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue