debugging, fix callback -> promise
This commit is contained in:
parent
806a80e3e5
commit
3a1f66f9e2
15
lib/core.js
15
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue