From cb12a9350332860971387e3a1fb40dc77fa992d3 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Mon, 8 Apr 2024 15:01:02 -0600 Subject: refactor(ext/tls): use cppgc to deduplicate the tls key loading code (#23289) Pass the certificates and key files as CPPGC objects. Towards #23233 --- ext/http/00_serve.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/http') diff --git a/ext/http/00_serve.js b/ext/http/00_serve.js index c87480a11..660287edb 100644 --- a/ext/http/00_serve.js +++ b/ext/http/00_serve.js @@ -70,7 +70,7 @@ import { resourceForReadableStream, } from "ext:deno_web/06_streams.js"; import { listen, listenOptionApiName, TcpConn } from "ext:deno_net/01_net.js"; -import { listenTls } from "ext:deno_net/02_tls.js"; +import { hasTlsKeyPairOptions, listenTls } from "ext:deno_net/02_tls.js"; import { SymbolAsyncDispose } from "ext:deno_web/00_infra.js"; const _upgraded = Symbol("_upgraded"); @@ -535,7 +535,7 @@ function serve(arg1, arg2) { options = {}; } - const wantsHttps = options.cert || options.key; + const wantsHttps = hasTlsKeyPairOptions(options); const wantsUnix = ObjectHasOwn(options, "path"); const signal = options.signal; const onError = options.onError ?? function (error) { -- cgit v1.2.3