summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/40_tls.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/js/40_tls.js b/runtime/js/40_tls.js
index 4fafe9079..ea094b6a7 100644
--- a/runtime/js/40_tls.js
+++ b/runtime/js/40_tls.js
@@ -68,6 +68,12 @@
conn,
{ hostname = "127.0.0.1", certFile } = {},
) {
+ if (
+ !(conn.localAddr.transport === "tcp" ||
+ conn.localAddr.transport === "udp")
+ ) {
+ throw new TypeError(`conn is not a valid network connection`);
+ }
const res = await opStartTls({
rid: conn.rid,
hostname,