disambiguate

This commit is contained in:
AJ ONeal 2016-08-01 21:16:25 -04:00
parent e8acedd6d7
commit 2f607314b9
1 changed files with 11 additions and 6 deletions

View File

@ -311,7 +311,7 @@ module.exports.create = function (deps) {
return handleErr(err, 'Failed to fetch issuer certificate'); return handleErr(err, 'Failed to fetch issuer certificate');
} }
state.caCert=certBufferToPem(body); state.caCertPem=certBufferToPem(body);
log('Requesting issuer certificate: done'); log('Requesting issuer certificate: done');
done(); done();
}); });
@ -319,10 +319,11 @@ module.exports.create = function (deps) {
} }
function done() { function done() {
var cert; var certPem;
var privkeyPem;
try { try {
cert = certBufferToPem(state.certificate); certPem = certBufferToPem(state.certificate);
} catch(e) { } catch(e) {
console.error(e.stack); console.error(e.stack);
//cb(new Error("Could not write output files. Please check permissions!")); //cb(new Error("Could not write output files. Please check permissions!"));
@ -330,10 +331,14 @@ module.exports.create = function (deps) {
return; return;
} }
privkeyPem = RSA.exportPrivateKeyPem(state.certKeypair);
cb(null, { cb(null, {
cert: cert cert: certPem
, key: RSA.exportPrivateKeyPem(state.certKeypair) // TODO nix key
, ca: state.caCert , key: privkeyPem
, privkey: privkeyPem
//, keypair: state.certKeypair // domainKeypair
, ca: state.caCertPem
}); });
} }