summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_tls_wrap.ts
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-02-21 18:13:01 +0530
committerGitHub <noreply@github.com>2024-02-21 18:13:01 +0530
commit061ee9d38cdf8ff0ade2373c1e075f841c534c47 (patch)
treeaac131b573bf051ef714c8c7f1a6bbc2c51de824 /ext/node/polyfills/_tls_wrap.ts
parentc75c9a072715d6c0f3a91725b75ff62708c5e011 (diff)
fix(ext/node): pass alpnProtocols to Deno.startTls (#22512)
Diffstat (limited to 'ext/node/polyfills/_tls_wrap.ts')
-rw-r--r--ext/node/polyfills/_tls_wrap.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/node/polyfills/_tls_wrap.ts b/ext/node/polyfills/_tls_wrap.ts
index 315cbf74a..a70dd29f1 100644
--- a/ext/node/polyfills/_tls_wrap.ts
+++ b/ext/node/polyfills/_tls_wrap.ts
@@ -68,7 +68,7 @@ export class TLSSocket extends net.Socket {
secureConnecting: boolean;
_SNICallback: any;
servername: string | null;
- alpnProtocol: any;
+ alpnProtocols: string[] | null;
authorized: boolean;
authorizationError: any;
[kRes]: any;
@@ -96,6 +96,7 @@ export class TLSSocket extends net.Socket {
caCerts = [new TextDecoder().decode(caCerts)];
}
tlsOptions.caCerts = caCerts;
+ tlsOptions.alpnProtocols = ["h2", "http/1.1"];
super({
handle: _wrapHandle(tlsOptions, socket),
@@ -113,7 +114,7 @@ export class TLSSocket extends net.Socket {
this.secureConnecting = true;
this._SNICallback = null;
this.servername = null;
- this.alpnProtocol = null;
+ this.alpnProtocols = tlsOptions.alpnProtocols;
this.authorized = false;
this.authorizationError = null;
this[kRes] = null;