From f9d3ec5f76a73a32e2cdae326890bacf2981d4ce Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 23 Dec 2018 13:38:32 -0700 Subject: [PATCH] v2.6.7: do not reset default cert if provided by user --- index.js | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 4646405..0852050 100644 --- a/index.js +++ b/index.js @@ -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( greenlock.tlsOptions , greenlock.middleware.sanitizeHost(function (req, res) { diff --git a/package.json b/package.json index 754f4d0..744d2cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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.", "main": "index.js", "homepage": "https://git.coolaj86.com/coolaj86/greenlock-express.js",