summaryrefslogtreecommitdiff
path: root/extensions/net/lib.deno_net.unstable.d.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2021-08-09 15:55:00 +0200
committerGitHub <noreply@github.com>2021-08-09 15:55:00 +0200
commit3ab50b355141f744a0acec1a5cc3b3b95247d4b1 (patch)
tree5ab6c3a216f5ce5cc5ee8fbc12e99dfac09496d7 /extensions/net/lib.deno_net.unstable.d.ts
parentf402904e6e227ee60a88d991cb9818d5340f5c1d (diff)
feat: support client certificates for connectTls (#11598)
Co-authored-by: Daniel Lamando <dan@danopia.net> Co-authored-by: Erik Price <github@erikprice.net>
Diffstat (limited to 'extensions/net/lib.deno_net.unstable.d.ts')
-rw-r--r--extensions/net/lib.deno_net.unstable.d.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/extensions/net/lib.deno_net.unstable.d.ts b/extensions/net/lib.deno_net.unstable.d.ts
index adeeb1466..145f232c0 100644
--- a/extensions/net/lib.deno_net.unstable.d.ts
+++ b/extensions/net/lib.deno_net.unstable.d.ts
@@ -191,6 +191,32 @@ declare namespace Deno {
options: ConnectOptions | UnixConnectOptions,
): Promise<Conn>;
+ export interface ConnectTlsClientCertOptions {
+ /** PEM formatted client certificate chain. */
+ certChain: string;
+ /** PEM formatted (RSA or PKCS8) private key of client certificate. */
+ privateKey: string;
+ }
+
+ /** **UNSTABLE** New API, yet to be vetted.
+ *
+ * Create a TLS connection with an attached client certificate.
+ *
+ * ```ts
+ * const conn = await Deno.connectTls({
+ * hostname: "deno.land",
+ * port: 443,
+ * certChain: "---- BEGIN CERTIFICATE ----\n ...",
+ * privateKey: "---- BEGIN PRIVATE KEY ----\n ...",
+ * });
+ * ```
+ *
+ * Requires `allow-net` permission.
+ */
+ export function connectTls(
+ options: ConnectTlsOptions & ConnectTlsClientCertOptions,
+ ): Promise<Conn>;
+
export interface StartTlsOptions {
/** A literal IP address or host name that can be resolved to an IP address.
* If not specified, defaults to `127.0.0.1`. */