From a409dd026d54a7aef17f9cf91a95a1e1b1f9c1ba Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 14 Dec 2015 12:22:57 -0800 Subject: [PATCH] use url file to download cert if present --- src/cert/acme.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cert/acme.js b/src/cert/acme.js index 2806907ed..8cf623803 100644 --- a/src/cert/acme.js +++ b/src/cert/acme.js @@ -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); }