diff --git a/lib/core.js b/lib/core.js index b3bf834..52a6b4f 100644 --- a/lib/core.js +++ b/lib/core.js @@ -382,7 +382,6 @@ module.exports.create = function (le) { // Certificates , getAsync: function (args) { var copy = utils.merge(args, le); - var renewing; args = utils.tplCopy(copy); return core.certificates.checkAsync(args).then(function (certs) { @@ -393,13 +392,14 @@ module.exports.create = function (le) { if (core.certificates._isRenewable(args, certs)) { // it's time to renew the available cert - renewing = core.certificates.renewAsync(args, certs); + certs.renewing = core.certificates.renewAsync(args, certs); if (args.waitForRenewal) { - return renewing; + return certs.renewing; } } // return existing unexpired (although potentially stale) certificates when available + // there will be an additional .renewing property if the certs are being asynchronously renewed return certs; }).then(function (results) { // returns pems