diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-04-09 16:23:22 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-09 16:23:22 -0600 |
commit | e190acbfa8b41f92291e73c405735ba0d7b5b172 (patch) | |
tree | 38183f93f9675c93b27674798f7949a75eebdac6 /tests/unit/tls_test.ts | |
parent | f23155bca76b761632b10d37574fe4543cbe9a26 (diff) |
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 }
```
Diffstat (limited to 'tests/unit/tls_test.ts')
-rw-r--r-- | tests/unit/tls_test.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unit/tls_test.ts b/tests/unit/tls_test.ts index 8f0a296c7..5be05b73e 100644 --- a/tests/unit/tls_test.ts +++ b/tests/unit/tls_test.ts @@ -1336,7 +1336,7 @@ Deno.test( }); }, TypeError, - "Cannot specify both `privateKey` and `key`", + "Cannot specify both `key` and `privateKey` for `Deno.connectTls`.", ); }, ); |