simply use fallback certs if LE fails

currently, it fails if we cannot get a cert.

This means that we need to provide some option to simply use fallback
cert. This requires UI changes that I want to avoid :-)
This commit is contained in:
Girish Ramakrishnan
2015-12-14 17:09:40 -08:00
parent a30277a4f8
commit 00a1bcef5d
+6 -2
View File
@@ -74,7 +74,7 @@ function installAdminCertificate(callback) {
if (error) return callback(error); // this cannot happen because we retry forever
ensureCertificate(config.adminFqdn(), function (error, certFilePath, keyFilePath) {
if (error) {
if (error) { // currently, this can never happen
debug('Error obtaining certificate. Proceed anyway', error);
return callback();
}
@@ -226,6 +226,10 @@ function ensureCertificate(domain, callback) {
debug('ensureCertificate: getting certificate for %s', domain);
api.getCertificate(domain, callback);
api.getCertificate(domain, function (error, certFilePath, keyFilePath) {
if (error) return callback(null, 'cert/host.cert', 'cert/host.key'); // use fallback certs
callback(null, certFilePath, keyFilePath);
});
});
}