diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-04-08 15:01:02 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-08 15:01:02 -0600 |
commit | cb12a9350332860971387e3a1fb40dc77fa992d3 (patch) | |
tree | 287def7ddad815423f8bc4196a76f9546940435d /ext/fetch/22_http_client.js | |
parent | 3826598974efd44c9d3da7694c0a325b011bc20a (diff) |
refactor(ext/tls): use cppgc to deduplicate the tls key loading code (#23289)
Pass the certificates and key files as CPPGC objects.
Towards #23233
Diffstat (limited to 'ext/fetch/22_http_client.js')
-rw-r--r-- | ext/fetch/22_http_client.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/fetch/22_http_client.js b/ext/fetch/22_http_client.js index c1ddbd7c4..e1389bbe1 100644 --- a/ext/fetch/22_http_client.js +++ b/ext/fetch/22_http_client.js @@ -14,6 +14,7 @@ import { core, primordials } from "ext:core/mod.js"; import { SymbolDispose } from "ext:deno_web/00_infra.js"; import { op_fetch_custom_client } from "ext:core/ops"; +import { loadTlsKeyPair } from "ext:deno_net/02_tls.js"; const { internalRidSymbol } = core; const { ObjectDefineProperty } = primordials; @@ -24,9 +25,16 @@ const { ObjectDefineProperty } = primordials; */ function createHttpClient(options) { options.caCerts ??= []; + const keyPair = loadTlsKeyPair( + options.cert, + undefined, + options.key, + undefined, + ); return new HttpClient( op_fetch_custom_client( options, + keyPair, ), ); } |