use url file to download cert if present

This commit is contained in:
Girish Ramakrishnan
2015-12-14 12:22:57 -08:00
parent 4731f8e5a7
commit a409dd026d
+9
View File
@@ -394,5 +394,14 @@ function getCertificate(domain, callback) {
assert.strictEqual(typeof domain, 'string');
assert.strictEqual(typeof callback, 'function');
var outdir = paths.APP_CERTS_DIR;
var certUrl = safe.fs.readFileSync(path.join(outdir, domain + '.url'), 'utf8');
if (certUrl) {
debug('getCertificate: renewing existing cert for %s from %s', domain, certUrl);
return downloadCertificate(domain, certUrl, callback);
}
debug('getCertificate: start acme flow for %s', domain);
acmeFlow(domain, callback);
}