This commit is contained in:
AJ ONeal 2015-12-15 13:23:30 +00:00
parent 29d1b614b8
commit 24c9884965
1 changed files with 6 additions and 6 deletions

View File

@ -123,7 +123,7 @@ function registerNewAccount(options, cb) {
} }
state.accountKeyPem=options.accountPrivateKeyPem; state.accountKeyPem=options.accountPrivateKeyPem;
state.accountKeyPair=cryptoUtil.importPemPrivateKey(state.accountKeyPEM); state.accountKeyPair=cryptoUtil.importPemPrivateKey(state.accountKeyPem);
state.acme=new Acme(state.accountKeyPair); state.acme=new Acme(state.accountKeyPair);
register(); register();
@ -139,7 +139,7 @@ function registerNewAccount(options, cb) {
var links; var links;
if (err || Math.floor(res.statusCode/100)!==2) { if (err || Math.floor(res.statusCode/100)!==2) {
return handleErr(err, 'Registration request failed'); return handleErr(err, 'Registration request failed: ' + res.body.toString('utf8'));
} }
links=parseLink(res.headers['link']); links=parseLink(res.headers['link']);
@ -229,10 +229,10 @@ function getCert(options, cb) {
state.domains = options.domains.slice(0); // copy array state.domains = options.domains.slice(0); // copy array
try { try {
state.accountKeyPem=options.accountPrivateKeyPem; state.accountKeyPem=options.accountPrivateKeyPem;
state.accountKeyPair=cryptoUtil.importPemPrivateKey(state.accountKeyPEM); state.accountKeyPair=cryptoUtil.importPemPrivateKey(state.accountKeyPem);
state.acme=new Acme(state.accountKeyPair); state.acme=new Acme(state.accountKeyPair);
state.certPrivateKeyPEM=options.domainPrivateKeyPem; state.certPrivateKeyPem=options.domainPrivateKeyPem;
state.certPrivateKey=cryptoUtil.importPemPrivateKey(state.certPrivateKeyPEM); state.certPrivateKey=cryptoUtil.importPemPrivateKey(state.certPrivateKeyPem);
} catch(err) { } catch(err) {
return handleErr(err, 'Failed to parse privateKey'); return handleErr(err, 'Failed to parse privateKey');
} }
@ -412,7 +412,7 @@ function getCert(options, cb) {
cb(null, { cb(null, {
cert: cert cert: cert
, key: state.certPrivateKeyPEM , key: state.certPrivateKeyPem
, ca: state.caCert , ca: state.caCert
}); });
} }