mirror of
https://github.com/oven-sh/bun
synced 2026-02-17 22:32:06 +00:00
net changes, ERR_TLS_PROTOCOL_VERSION_CONFLICT fix message
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user