diff --git a/lib/webserver.js b/lib/webserver.js index 0787af25..4d061ae4 100644 --- a/lib/webserver.js +++ b/lib/webserver.js @@ -328,17 +328,15 @@ WebServer.prototype = { } //secureOptions and secureProtocol documented here: //https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options - if (typeof options.secureOptions == 'number') { + if (options.maxTls || options.minTls) { + this.httpsOptions.maxTls = options.maxTls; + this.httpsOptions.minTls = options.minTls; + } else if (typeof options.secureOptions == 'number') { //the numbers you want here actually come from openssl, and are likely //in this file: https://github.com/openssl/openssl/blob/master/include/openssl/ssl.h this.httpsOptions.secureOptions = options.secureOptions; } else if (typeof options.secureProtocol == 'string') { this.httpsOptions.secureProtocol = options.secureProtocol; - } else { - let consts = crypto.constants; - //tls 1.3 was released in 2018, and tls 1.2 should be in this blacklist list when it has widespread support - this.httpsOptions.secureOptions = consts.SSL_OP_NO_SSLv2 | - consts.SSL_OP_NO_SSLv3 | consts.SSL_OP_NO_TLSv1 | consts.SSL_OP_NO_TLSv1_1; } let ciphers = readCiphersFromArray(options.ciphers);