From 5758470ee47063d4a0b65fcba1441dfb8a8ace54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 11 Apr 2024 21:31:11 +0100 Subject: =?UTF-8?q?Revert=20"refactor(ext/net):=20extract=20TLS=20key=20an?= =?UTF-8?q?d=20certificate=20from=20inter=E2=80=A6=20(#23325)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …faces (#23296)" This reverts commit e190acbfa8b41f92291e73c405735ba0d7b5b172. Reverting because it broke stable API type declarations. We will reland it for v1.43 with updated interfaces --- cli/tsc/dts/lib.deno.ns.d.ts | 8 +++++++- cli/tsc/dts/lib.deno.unstable.d.ts | 25 ++++--------------------- 2 files changed, 11 insertions(+), 22 deletions(-) (limited to 'cli') diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 4ec687359..1d6b398f5 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -6276,7 +6276,13 @@ declare namespace Deno { * * @category HTTP Server */ - export type ServeTlsOptions = ServeOptions & TlsCertifiedKeyOptions; + export interface ServeTlsOptions extends ServeOptions { + /** Server private key in PEM format */ + cert: string; + + /** Cert chain in PEM format */ + key: string; + } /** * @category HTTP Server diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index ae3f60d28..056d8e609 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -882,6 +882,10 @@ declare namespace Deno { caCerts?: string[]; /** A HTTP proxy to use for new connections. */ proxy?: Proxy; + /** Cert chain in PEM format. */ + cert?: string; + /** Server private key in PEM format. */ + key?: string; /** Sets the maximum numer of idle connections per host allowed in the pool. */ poolMaxIdlePerHost?: number; /** Set an optional timeout for idle sockets being kept-alive. @@ -958,27 +962,6 @@ declare namespace Deno { options: CreateHttpClientOptions, ): HttpClient; - /** **UNSTABLE**: New API, yet to be vetted. - * - * Create a custom HttpClient to use with {@linkcode fetch}. This is an - * extension of the web platform Fetch API which allows Deno to use custom - * TLS certificates and connect via a proxy while using `fetch()`. - * - * @example ```ts - * const caCert = await Deno.readTextFile("./ca.pem"); - * // Load a client key and certificate that we'll use to connect - * const key = await Deno.readTextFile("./key.key"); - * const cert = await Deno.readTextFile("./cert.crt"); - * const client = Deno.createHttpClient({ caCerts: [ caCert ], key, cert }); - * const response = await fetch("https://myserver.com", { client }); - * ``` - * - * @category Fetch API - */ - export function createHttpClient( - options: CreateHttpClientOptions & TlsCertifiedKeyOptions, - ): HttpClient; - /** **UNSTABLE**: New API, yet to be vetted. * * Represents membership of a IPv4 multicast group. -- cgit v1.2.3