From 6a9afcbc26d10692230cf95e94ef62b17a8d49ed Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Mon, 22 Jan 2024 23:21:01 +0100 Subject: [PATCH] Add support for useClientCertificate, rejectUnauthorizedClientCertificates, cipherSuite, ecdhCurve, tlsMinVersion, tlsMaxVersion, signatureAlgorithms and http2Settings config.json properties. --- svr.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/svr.js b/svr.js index a02ba7c..b39c011 100644 --- a/svr.js +++ b/svr.js @@ -2065,12 +2065,21 @@ if (!cluster.isPrimary) { allowHTTP1: true, requireHostHeader: false, key: key, - cert: cert + cert: cert, + requestCert: configJSON.useClientCertificate, + rejectUnauthorized: configJSON.rejectUnauthorizedClientCertificates, + ciphers: configJSON.cipherSuite, + ecdhCurve: configJSON.ecdhCurve, + minVersion: configJSON.tlsMinVersion, + maxVersion: configJSON.tlsMaxVersion, + sigalgs: configJSON.signatureAlgorithms, + settings: configJSON.http2Settings }); } else { server = http2.createServer({ allowHTTP1: true, - requireHostHeader: false + requireHostHeader: false, + settings: configJSON.http2Settings }); } } else { @@ -2078,7 +2087,14 @@ if (!cluster.isPrimary) { server = https.createServer({ key: key, cert: cert, - requireHostHeader: false + requireHostHeader: false, + requestCert: configJSON.useClientCertificate, + rejectUnauthorized: configJSON.rejectUnauthorizedClientCertificates, + ciphers: configJSON.cipherSuite, + ecdhCurve: configJSON.ecdhCurve, + minVersion: configJSON.tlsMinVersion, + maxVersion: configJSON.tlsMaxVersion, + sigalgs: configJSON.signatureAlgorithms }); } else { try {