net changes, ERR_TLS_PROTOCOL_VERSION_CONFLICT fix message

This commit is contained in:
Alistair Smith
2025-05-09 14:57:52 -07:00
parent d72e605ab2
commit 2798379edf
2 changed files with 11 additions and 8 deletions

View File

@@ -350,12 +350,12 @@ const ServerHandlers: SocketHandler = {
const self = this.data;
socket[kServerSocket] = self._handle;
const options = self[bunSocketServerOptions];
const { pauseOnConnect, connectionListener, [kSocketClass]: SClass, requestCert, rejectUnauthorized } = options;
const _socket = new SClass({
minVersion: self.minVersion,
maxVersion: self.maxVersion,
});
console.log(options);
const _socket = new SClass(options);
_socket.isServer = true;
_socket.server = self;
@@ -1453,6 +1453,9 @@ Server.prototype.listen = function listen(port, hostname, onListen) {
if (typeof bunTLS === "function") {
[tls, TLSSocketClass] = bunTLS.$call(this, port, hostname, false);
options.servername = tls.serverName;
options.minVersion = tls.minVersion;
options.maxVersion = tls.maxVersion;
options[kSocketClass] = TLSSocketClass;
contexts = tls.contexts;
if (!tls.requestCert) {

View File

@@ -336,8 +336,8 @@ var InternalSecureContext = class SecureContext {
if (hasSecureProtocol && (hasMinVersionOption || hasMaxVersionOption)) {
throw $ERR_TLS_PROTOCOL_VERSION_CONFLICT(
"options.secureProtocol",
hasMinVersionOption ? "options.minVersion" : "options.maxVersion",
TLS_VERSION_REVERSE_MAP[hasMinVersionOption ? options.minVersion : options.maxVersion],
secureProtocol,
);
}
@@ -658,8 +658,8 @@ function Server(options, secureConnectionListener): void {
if (hasSecureProtocol && (hasMinVersionOption || hasMaxVersionOption)) {
throw $ERR_TLS_PROTOCOL_VERSION_CONFLICT(
"options.secureProtocol",
hasMinVersionOption ? "options.minVersion" : "options.maxVersion",
TLS_VERSION_REVERSE_MAP[hasMinVersionOption ? options.minVersion : options.maxVersion],
secureProtocol,
);
}