Open
Description
Version
v22.9.0
Platform
Darwin Omers-MacBook-Pro.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000 arm6
Subsystem
tls
What steps will reproduce the bug?
When a new instance of TLSSocket
is created with the options.isServer
set as true
, the getProtocol
instance method does not return null
.
I'm not sure if this qualifies as a bug, however, the docs states as follows:
The value null will be returned for server sockets or disconnected client sockets.
import { TLSSocket } from 'node:tls'
import { Socket } from 'node:net'
const tlsSocket = new TLSSocket(new Socket(), {
isServer: true
})
console.log('TLS Socket Protocol:', tlsSocket.getProtocol()) // TLSv1.3
Adding versions of openssl as well as default min and max versions if it might be helpful:
import { versions } from 'node:process'
import { DEFAULT_MIN_VERSION, DEFAULT_MAX_VERSION } from 'node:tls'
console.log(versions.openssl) // 3.0.13+quic
console.log(DEFAULT_MIN_VERSION) // TLSv1.2
console.log(DEFAULT_MAX_VERSION) // TLSv1.3
How often does it reproduce? Is there a required condition?
I have not seen it returning null
.
What is the expected behavior? Why is that the expected behavior?
The expected behavior is that it returns null
as described per docs here:
https://nodejs.org/api/tls.html#tlssocketgetprotocol
What do you see instead?
I instead see the string value TLSv1.3
.
Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels
Activity