From 3a1f66f9e205610db1b363cc732bbb7c0a7ad2ee Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 19 Dec 2015 22:26:12 +0000 Subject: [PATCH] debugging, fix callback -> promise --- lib/core.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/core.js b/lib/core.js index e512b64..b3e7248 100644 --- a/lib/core.js +++ b/lib/core.js @@ -35,8 +35,13 @@ function getAcmeUrls(args) { function getCertificateAsync(account, args, defaults, handlers) { return leCrypto.generateRsaKeypairAsync(args.rsaKeySize, args.rsaExponent).then(function (domainKey) { + if (args.debug) { + console.log("get certificate"); + } return LeCore.getCertificateAsync({ - newAuthzUrl: args._acmeUrls.newAuthz + debug: args.debug + + , newAuthzUrl: args._acmeUrls.newAuthz , newCertUrl: args._acmeUrls.newCert , accountPrivateKeyPem: account.privateKeyPem @@ -82,11 +87,15 @@ function getCertificateAsync(account, args, defaults, handlers) { } } }).then(function (result) { + if (args.debug) { + console.log("got certificate!"); + } + result.fullchain = result.cert + '\n' + result.ca; var pyconf = PromiseA.promisifyAll(require('pyconf')); - return pyconf.readFileAsync(args.renewalPath, function (obj) { + return pyconf.readFileAsync(args.renewalPath).then(function (obj) { return obj; }, function () { return pyconf.readFileAsync(path.join(__dirname, 'lib', 'renewal.conf.tpl')).then(function (obj) { @@ -204,7 +213,7 @@ function registerWithAcme(args, defaults, handlers) { args.renewalPath = args.renewalPath || path.join(configDir, 'renewal', args.domains[0] + '.conf'); args.accountsDir = args.accountsDir || path.join(configDir, 'accounts', acmeHostname, 'directory'); - return pyconf.readFileAsync(args.renewalDir).then(function (renewal) { + return pyconf.readFileAsync(args.renewalPath).then(function (renewal) { var accountId = renewal.account; renewal = renewal.account;