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