summaryrefslogtreecommitdiff
path: root/ext/net/02_tls.js
diff options
context:
space:
mode:
authorYury Selivanov <yury@edgedb.com>2021-11-26 10:59:53 -0800
committerGitHub <noreply@github.com>2021-11-26 19:59:53 +0100
commit1d3f734e1815bf1649e0cac445be9eacb4cd296d (patch)
treef0178e951f3f44313def5d7ea8e2e391219f7791 /ext/net/02_tls.js
parentd763633781be484bb19b458208dd7c11efb83228 (diff)
feat(ext/net): ALPN support in `Deno.connectTls()` (#12786)
Diffstat (limited to 'ext/net/02_tls.js')
-rw-r--r--ext/net/02_tls.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/net/02_tls.js b/ext/net/02_tls.js
index 9ae6cb055..00acd7c96 100644
--- a/ext/net/02_tls.js
+++ b/ext/net/02_tls.js
@@ -41,6 +41,7 @@
caCerts = [],
certChain = undefined,
privateKey = undefined,
+ alpnProtocols = undefined,
}) {
const res = await opConnectTls({
port,
@@ -50,6 +51,7 @@
caCerts,
certChain,
privateKey,
+ alpnProtocols,
});
return new TlsConn(res.rid, res.remoteAddr, res.localAddr);
}
@@ -67,7 +69,7 @@
keyFile,
hostname = "0.0.0.0",
transport = "tcp",
- alpnProtocols,
+ alpnProtocols = undefined,
}) {
const res = opListenTls({
port,
@@ -82,13 +84,19 @@
async function startTls(
conn,
- { hostname = "127.0.0.1", certFile = undefined, caCerts = [] } = {},
+ {
+ hostname = "127.0.0.1",
+ certFile = undefined,
+ caCerts = [],
+ alpnProtocols = undefined,
+ } = {},
) {
const res = await opStartTls({
rid: conn.rid,
hostname,
certFile,
caCerts,
+ alpnProtocols,
});
return new TlsConn(res.rid, res.remoteAddr, res.localAddr);
}