From 827310a645568fbd3a3f7d3a4cd7c328e57a2f83 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 7 Mar 2018 08:44:22 +0200 Subject: [PATCH] Apply ECDH curve fix only on affected version Fixes #2162 --- src/plugins/irc-events/link.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/irc-events/link.js b/src/plugins/irc-events/link.js index 50cfeedf..01599c69 100644 --- a/src/plugins/irc-events/link.js +++ b/src/plugins/irc-events/link.js @@ -15,9 +15,11 @@ process.setMaxListeners(0); // This is fixed in Node 10, but The Lounge supports LTS versions // https://github.com/nodejs/node/issues/16196 // https://github.com/nodejs/node/pull/16853 +// https://github.com/nodejs/node/pull/15206 const tls = require("tls"); +const semver = require("semver"); -if (tls.DEFAULT_ECDH_CURVE === "prime256v1") { +if (semver.gte(process.version, "8.6.0") && tls.DEFAULT_ECDH_CURVE === "prime256v1") { tls.DEFAULT_ECDH_CURVE = "auto"; }