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