mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
refactor: set removal version for Deno.ListenTlsOptions.certFile
, Deno.ListenTlsOptions.keyFile
and Deno.ConnectTlsOptions.certFile
(#22026)
This change: 1. Sets the removal version for `Deno.ListenTlsOptions.certFile`, `Deno.ListenTlsOptions.keyFile` and `Deno.ConnectTlsOptions.certFile` for Deno v2, in favour of the `cert`, `key` and `caCerts` options, respectively. 2. Replaces use of the deprecated options with the new recommended options. Towards #22021
This commit is contained in:
parent
b0febea47f
commit
18a235e608
8 changed files with 64 additions and 34 deletions
19
ext/net/lib.deno_net.d.ts
vendored
19
ext/net/lib.deno_net.d.ts
vendored
|
@ -174,13 +174,17 @@ declare namespace Deno {
|
|||
* `--allow-read`.
|
||||
*
|
||||
* @tags allow-read
|
||||
* @deprecated This option is deprecated and will be removed in Deno 2.0.
|
||||
* @deprecated Pass the certificate file contents directly to the
|
||||
* {@linkcode Deno.ListenTlsOptions.cert} option instead. This option will
|
||||
* be removed in Deno 2.0.
|
||||
*/
|
||||
certFile?: string;
|
||||
/** Server private key file. Requires `--allow-read`.
|
||||
*
|
||||
* @tags allow-read
|
||||
* @deprecated This option is deprecated and will be removed in Deno 2.0.
|
||||
* @deprecated Pass the key file contents directly to the
|
||||
* {@linkcode Deno.ListenTlsOptions.key} option instead. This option will
|
||||
* be removed in Deno 2.0.
|
||||
*/
|
||||
keyFile?: string;
|
||||
|
||||
|
@ -197,7 +201,11 @@ declare namespace Deno {
|
|||
* security).
|
||||
*
|
||||
* ```ts
|
||||
* const lstnr = Deno.listenTls({ port: 443, certFile: "./server.crt", keyFile: "./server.key" });
|
||||
* using listener = Deno.listenTls({
|
||||
* port: 443,
|
||||
* cert: Deno.readTextFileSync("./server.crt"),
|
||||
* key: Deno.readTextFileSync("./server.key"),
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Requires `allow-net` permission.
|
||||
|
@ -289,8 +297,9 @@ declare namespace Deno {
|
|||
/**
|
||||
* Server certificate file.
|
||||
*
|
||||
* @deprecated This option is deprecated and will be removed in a future
|
||||
* release.
|
||||
* @deprecated Pass the cert file contents directly to the
|
||||
* {@linkcode Deno.ConnectTlsOptions.caCerts} option instead. This option
|
||||
* will be removed in Deno 2.0.
|
||||
*/
|
||||
certFile?: string;
|
||||
/** A list of root certificates that will be used in addition to the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue