Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.unstable.d.ts>Deno.connectTls

A modern runtime for JavaScript and TypeScript.
Go to Latest
function Deno.connectTls
allow-net
import { Deno } from "https://deno.land/x/deno@v1.36.0/cli/tsc/dts/lib.deno.unstable.d.ts";
const { connectTls } = Deno;

UNSTABLE: New API, yet to be vetted.

Create a TLS connection with an attached client certificate.

const conn = await Deno.connectTls({
  hostname: "deno.land",
  port: 443,
  certChain: "---- BEGIN CERTIFICATE ----\n ...",
  privateKey: "---- BEGIN PRIVATE KEY ----\n ...",
});

Requires allow-net permission.