|
|
@ -382,6 +382,7 @@ 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) { |
|
|
@ -391,9 +392,14 @@ module.exports.create = function (le) { |
|
|
|
} |
|
|
|
|
|
|
|
if (core.certificates._isRenewable(args, certs)) { |
|
|
|
certs._renewing = core.certificates.renewAsync(args, certs); |
|
|
|
// it's time to renew the available cert
|
|
|
|
renewing = core.certificates.renewAsync(args, certs); |
|
|
|
if (args.waitForRenewal) { |
|
|
|
return renewing; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// return existing unexpired (although potentially stale) certificates when available
|
|
|
|
return certs; |
|
|
|
}).then(function (results) { |
|
|
|
// returns pems
|
|
|
|