Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TLSSocket.alpnProtocol in node:tls compat #26127

Closed
scotttrinh opened this issue Oct 10, 2024 · 0 comments
Closed

Support TLSSocket.alpnProtocol in node:tls compat #26127

scotttrinh opened this issue Oct 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@scotttrinh
Copy link

The TLSSocket.alpnProtocol property is referenced in the docs, but does not appear to actually exist:

export class TLSSocket extends net.Socket {
_tlsOptions: any;
_secureEstablished: boolean;
_securePending: boolean;
_newSessionPending: boolean;
_controlReleased: boolean;
secureConnecting: boolean;
_SNICallback: any;
servername: string | null;
alpnProtocols: string[] | null;
authorized: boolean;
authorizationError: any;
[kRes]: any;
[kIsVerified]: boolean;
[kPendingSession]: any;
[kConnectOptions]: any;
ssl: any;

In Deno.TlsConn we have .handshake that will return the ALPN protocol selected during the handshake:

pub async fn handshake(

In Node, it is set on the TLSSocket instance:

https://github.com/nodejs/node/blob/4988bb549e79a6b92391b4ff529f675da32c0687/lib/_tls_wrap.js#L1063
https://github.com/nodejs/node/blob/4988bb549e79a6b92391b4ff529f675da32c0687/src/crypto/crypto_tls.cc#L2078-L2102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

No branches or pull requests

3 participants