Merge pull request #2163 from thelounge/xpaw/fix-2162

Apply ECDH curve fix only on affected version
This commit is contained in:
Pavel Djundik 2018-03-07 09:16:50 +02:00 committed by GitHub
commit c63c0f2ec8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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";
}