summaryrefslogtreecommitdiff
path: root/ext/net/02_tls.js
AgeCommit message (Collapse)Author
2024-10-01refactor(ext): align error messages (#25914)Ian Bull
Aligns the error messages in the ext folder to be in-line with the Deno style guide. https://github.com/denoland/deno/issues/25269 <!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. -->
2024-09-11BREAKING(net): remove `Deno.[Tls]Listener.prototype.rid` (#25556)Asher Gomez
Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-10BREAKING(net): remove ↵Asher Gomez
`Deno.ConnectTlsOptions.{certChain,certFile,privateKey}` and `Deno.ListenTlsOptions.certChain,certFile,keyFile}` (#25525) Towards #22079
2024-09-06BREAKING(net): remove `Deno.{Conn,TlsConn,TcpConn,UnixConn}.prototype.rid` ↵Asher Gomez
(#25446) Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-06fix(runtime): use more null proto objects again (#25040)Kenta Moriuchi
proceed with #23921 This PR is a preparation for https://github.com/denoland/deno_lint/pull/1307 --------- Signed-off-by: Kenta Moriuchi <moriken@kimamass.com> Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-08-20fix(ext/net): validate port in Deno.{connect,serve,listen} (#24399)seb
Co-authored-by: Will Leach <4619280+melbourne2991@users.noreply.github.com> Co-authored-by: Luca Casonato <hello@lcas.dev> Co-authored-by: David Sherret <dsherret@gmail.com>
2024-05-23fix(runtime): use more null proto objects (#23921)Luca Casonato
This is a primordialization effort to improve resistance against users tampering with the global `Object` prototype. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-09refactor(ext/tls): Implement required functionality for later SNI support ↵Matt Mastracci
(#23686) Precursor to #23236 This implements the SNI features, but uses private symbols to avoid exposing the functionality at this time. Note that to properly test this feature, we need to add a way for `connectTls` to specify a hostname. This is something that should be pushed into that API at a later time as well. ```ts Deno.test( { permissions: { net: true, read: true } }, async function listenResolver() { let sniRequests = []; const listener = Deno.listenTls({ hostname: "localhost", port: 0, [resolverSymbol]: (sni: string) => { sniRequests.push(sni); return { cert, key, }; }, }); { const conn = await Deno.connectTls({ hostname: "localhost", [serverNameSymbol]: "server-1", port: listener.addr.port, }); const [_handshake, serverConn] = await Promise.all([ conn.handshake(), listener.accept(), ]); conn.close(); serverConn.close(); } { const conn = await Deno.connectTls({ hostname: "localhost", [serverNameSymbol]: "server-2", port: listener.addr.port, }); const [_handshake, serverConn] = await Promise.all([ conn.handshake(), listener.accept(), ]); conn.close(); serverConn.close(); } assertEquals(sniRequests, ["server-1", "server-2"]); listener.close(); }, ); ``` --------- Signed-off-by: Matt Mastracci <matthew@mastracci.com>
2024-04-24fix(ext/net): check for TLS using undefined rather than using ReflectHas ↵Matt Mastracci
(#23538) Fixes #23537
2024-04-21FUTURE(ext/net): remove `Deno.ListenTlsOptions.(keyFile|certFile)` (#23271)Asher Gomez
Towards #23089 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-04-18feat(ext/net): extract TLS key and certificate from interfaces (#23327)Bartek Iwańczuk
Relands #23325
2024-04-11Revert "refactor(ext/net): extract TLS key and certificate from inter… ↵Bartek Iwańczuk
(#23325) …faces (#23296)" This reverts commit e190acbfa8b41f92291e73c405735ba0d7b5b172. Reverting because it broke stable API type declarations. We will reland it for v1.43 with updated interfaces
2024-04-09refactor(ext/net): extract TLS key and certificate from interfaces (#23296)Matt Mastracci
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 } ```
2024-04-08refactor(ext/tls): use cppgc to deduplicate the tls key loading code (#23289)Matt Mastracci
Pass the certificates and key files as CPPGC objects. Towards #23233
2024-03-11chore: enable clippy unused_async rule (#22834)David Sherret
2024-02-18feat: `Deno.ConnectTlsOptions.{cert,key}` (#22274)Asher Gomez
Towards #22197
2024-02-13chore: cleanup `ext/net/02_tls.js` (#22032)Asher Gomez
`certFile` was being passed to `op_tls_start()` when it's unused and undocumented. Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-01-26refactor: migrate extensions to virtual ops module (#22135)Bartek Iwańczuk
First pass of migrating away from `Deno.core.ensureFastOps()`. A few "tricky" ones have been left for a follow up.
2024-01-26refactor: make 'rid' properties non-enumerable (#22137)Bartek Iwańczuk
Now these props will not show up when inspecting objects in console.
2024-01-26chore: upgrade deno_core (#22124)Bartek Iwańczuk
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-01-25fix: don't use public rid accessors in internal APIs (#22091)Bartek Iwańczuk
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-24fix: use `warnOnDeprecatedApi()` in `Deno.TlsListener.rid` (#22089)Asher Gomez
Missed in #22077
2024-01-24feat: deprecate `Deno.{Conn,TcpConn,TlsConn,UnixConn}.rid` (#22077)Asher Gomez
For removal in Deno v2. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-23refactor: set removal version for `Deno.ListenTlsOptions.certFile`, ↵Asher Gomez
`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
2024-01-10refactor: use `core.ensureFastOps()` (#21888)Kenta Moriuchi
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-27perf: remove opAsync (#21690)Matt Mastracci
`opAsync` requires a lookup by name on each async call. This is a mechanical translation of all opAsync calls to ensureFastOps. The `opAsync` API on Deno.core will be removed at a later time.
2023-12-07refactor: pull 'core', 'internals', 'primordials' from ES module (#21462)Bartek Iwańczuk
This commit refactors how we access "core", "internals" and "primordials" objects coming from `deno_core`, in our internal JavaScript code. Instead of capturing them from "globalThis.__bootstrap" namespace, we import them from recently added "ext:core/mod.js" file.
2023-07-25fix(ext/net): fix string port number handling in listen (#19921)Yoshiya Hinosawa
While string `port` is not allowed in typing, it seems we used to support that and now it's broken. ref: https://github.com/denoland/deno/issues/10064#issuecomment-1637427260 This PR restores the support of string port number in `listen` and `listenTls`
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
2023-02-07 refactor: remove prefix from include_js_files & use extension name (#17683)Leo Kettmeir
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-16chore: update dlint to v0.37.0 for GitHub Actions (#17295)Kenta Moriuchi
Updated third_party dlint to v0.37.0 for GitHub Actions. This PR includes following changes: * fix(prefer-primordials): Stop using array pattern assignments * fix(prefer-primordials): Stop using global intrinsics except for `SharedArrayBuffer` * feat(guard-for-in): Apply new guard-for-in rule
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-10-26feat(ext/net): reusePort for TCP on Linux (#16398)Luca Casonato
2022-10-25Revert "Revert "refactor(ext/net): clean up variadic network ops (#16… ↵Bartek Iwańczuk
(#16422) …392)" (#16417)" This reverts commit 8e3f825c921b38141afa7a69a0664881c5c94461.
2022-10-25Revert "refactor(ext/net): clean up variadic network ops (#16392)" (#16417)Bartek Iwańczuk
Should fix https://github.com/denoland/deno_std/issues/2807
2022-10-24refactor(ext/net): clean up variadic network ops (#16392)Luca Casonato
Previously `op_net_listen`, `op_net_accept`, and various other ops in ext/net where variadic on the transport. This created a lot of code bloat. This commit updates the code to instead have separate ops for each transport.
2022-08-11perf(ops): Monomorphic sync op calls (#15337)Aapo Alasuutari
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params). Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple: ``` opSync("op_foo", param1, param2); // -> turns to ops.op_foo(param1, param2); ``` This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path. Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-02-24feat(ext/net): support cert, key options in listenTls (#13740)Yoshiya Hinosawa
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2021-11-26feat(ext/net): ALPN support in `Deno.connectTls()` (#12786)Yury Selivanov
2021-10-30cleanup(ext/net): consistent op names (#12607)Aaron O'Mullan
2021-10-26feat(ext/net): add TlsConn.handshake() (#12467)Bert Belder
A `handshake()` method was added that returns when the TLS handshake is complete. The `TlsListener` and `TlsConn` interfaces were added to accomodate this new method. Closes: #11759.
2021-09-30feat(tls): custom in memory CA certificates (#12219)Luca Casonato
This adds support for using in memory CA certificates for `Deno.startTLS`, `Deno.connectTLS` and `Deno.createHttpClient`. `certFile` is deprecated in `startTls` and `connectTls`, and removed from `Deno.createHttpClient`.
2021-08-11Rename extensions/ directory to ext/ (#11643)Ryan Dahl