# HG changeset patch # User Kim Alvefur # Date 1723137502 -7200 # Node ID a97c11584042ac7dd1375af5112186b5e9c8eb0e # Parent 997d9ad12477aec51df011c3900fc8ef4696a6e7 net.http: Throw error if missing TLS context for HTTPS request Prevents the mistake of creating a http context without any TLS context and then trying to use HTTPS, which doesn't work right. Thanks nils diff -r 997d9ad12477 -r a97c11584042 net/http.lua --- a/net/http.lua Thu Jul 11 15:24:19 2024 +0200 +++ b/net/http.lua Thu Aug 08 19:18:22 2024 +0200 @@ -294,6 +294,9 @@ if ex and ex.use_dane ~= nil then use_dane = ex.use_dane; end + if not sslctx then + error("Attempt to make HTTPS request but no 'sslctx' provided in options"); + end end local http_service = basic_resolver.new(host, port_number, "tcp", { servername = req.host; use_dane = use_dane });