v2.6.7: do not reset default cert if provided by user

This commit is contained in:
AJ ONeal 2018-12-23 13:38:32 -07:00
parent 7bcd7a2bf7
commit f9d3ec5f76
2 changed files with 7 additions and 1 deletions

View File

@ -153,6 +153,12 @@ module.exports.create = function (opts) {
}); });
}); });
}; };
if (greenlock.tlsOptions.cert) {
server._hasDefaultSecureContext = true;
if (greenlock.tlsOptions.cert.toString('ascii').split("BEGIN").length < 3) {
console.warn("Invalid certificate file. 'tlsOptions.cert' should contain cert.pem (certificate file) *and* chain.pem (intermediate certificates) seperated by an extra newline (CRLF)");
}
}
server = https.createServer( server = https.createServer(
greenlock.tlsOptions greenlock.tlsOptions
, greenlock.middleware.sanitizeHost(function (req, res) { , greenlock.middleware.sanitizeHost(function (req, res) {

View File

@ -1,6 +1,6 @@
{ {
"name": "greenlock-express", "name": "greenlock-express",
"version": "2.6.6", "version": "2.6.7",
"description": "Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.", "description": "Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.",
"main": "index.js", "main": "index.js",
"homepage": "https://git.coolaj86.com/coolaj86/greenlock-express.js", "homepage": "https://git.coolaj86.com/coolaj86/greenlock-express.js",