From e190acbfa8b41f92291e73c405735ba0d7b5b172 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Tue, 9 Apr 2024 16:23:22 -0600 Subject: refactor(ext/net): extract TLS key and certificate from interfaces (#23296) Removes the certificate options from all the interfaces and replaces them with a new `TlsCertifiedKeyOptions`. This allows us to centralize the documentation for TLS key management for both client and server, and will allow us to add key object support in the future. Also adds an option `keyFormat` field to the cert/key that must be omitted or set to `pem`. This will allow us to load other format keys in the future `der`, `pfx`, etc. In a future PR, we will add a way to load a certified key object, and we will add another option to `TlsCertifiedKeyOptions` like so: ```ts export interface TlsCertifiedKeyOptions = | TlsCertifiedKeyPem | TlsCertifiedKeyFromFile | TlsCertifiedKeyConnectTls | { key: Deno.CertifiedKey } ``` --- cli/tsc/dts/lib.deno.ns.d.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'cli/tsc/dts/lib.deno.ns.d.ts') diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 80c985184..cc73efbf9 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -6281,13 +6281,7 @@ declare namespace Deno { * * @category HTTP Server */ - export interface ServeTlsOptions extends ServeOptions { - /** Server private key in PEM format */ - cert: string; - - /** Cert chain in PEM format */ - key: string; - } + export type ServeTlsOptions = ServeOptions & TlsCertifiedKeyOptions; /** * @category HTTP Server -- cgit v1.2.3