1
0
Fork 0
forked from svrjs/svrjs

Add support for useClientCertificate, rejectUnauthorizedClientCertificates, cipherSuite, ecdhCurve, tlsMinVersion, tlsMaxVersion, signatureAlgorithms and http2Settings config.json properties.

This commit is contained in:
Dorian Niemiec 2024-01-22 23:21:01 +01:00
parent 1a2019664a
commit 6a9afcbc26

22
svr.js
View file

@ -2065,12 +2065,21 @@ if (!cluster.isPrimary) {
allowHTTP1: true, allowHTTP1: true,
requireHostHeader: false, requireHostHeader: false,
key: key, 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 { } else {
server = http2.createServer({ server = http2.createServer({
allowHTTP1: true, allowHTTP1: true,
requireHostHeader: false requireHostHeader: false,
settings: configJSON.http2Settings
}); });
} }
} else { } else {
@ -2078,7 +2087,14 @@ if (!cluster.isPrimary) {
server = https.createServer({ server = https.createServer({
key: key, key: key,
cert: cert, 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 { } else {
try { try {