diff options
Diffstat (limited to 'ext/net/02_tls.js')
-rw-r--r-- | ext/net/02_tls.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/ext/net/02_tls.js b/ext/net/02_tls.js index 6fa5bff20..e71bd77f5 100644 --- a/ext/net/02_tls.js +++ b/ext/net/02_tls.js @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { core, primordials } from "ext:core/mod.js"; +import { core, internals, primordials } from "ext:core/mod.js"; const { op_net_accept_tls, op_net_connect_tls, @@ -39,6 +39,13 @@ async function connectTls({ privateKey = undefined, alpnProtocols = undefined, }) { + if (certFile !== undefined) { + internals.warnOnDeprecatedApi( + "Deno.ConnectTlsOptions.certFile", + new Error().stack, + "Pass the cert file contents to the `Deno.ConnectTlsOptions.certChain` option instead.", + ); + } if (transport !== "tcp") { throw new TypeError(`Unsupported transport: '${transport}'`); } @@ -76,6 +83,20 @@ function listenTls({ if (transport !== "tcp") { throw new TypeError(`Unsupported transport: '${transport}'`); } + if (keyFile !== undefined) { + internals.warnOnDeprecatedApi( + "Deno.ListenTlsOptions.keyFile", + new Error().stack, + "Pass the key file contents to the `Deno.ListenTlsOptions.key` option instead.", + ); + } + if (certFile !== undefined) { + internals.warnOnDeprecatedApi( + "Deno.ListenTlsOptions.certFile", + new Error().stack, + "Pass the cert file contents to the `Deno.ListenTlsOptions.cert` option instead.", + ); + } const { 0: rid, 1: localAddr } = op_net_listen_tls( { hostname, port: Number(port) }, { cert, certFile, key, keyFile, alpnProtocols, reusePort }, |