[llvm] [lldb][Windows] Try falling back to TLS 1.2 before erroring out (PR #206108)

Charles Zablit via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 08:19:44 PDT 2026


https://github.com/charles-zablit created https://github.com/llvm/llvm-project/pull/206108

TLS 1.3 is only supported on Windows Server 2022 and beyond. Windows Server 2019 only supports up to TLS 1.2.

This causes test failures on CI runners which run on Windows Server 2019.

This patch allows falling back to TLS 1.2 if 1.3 is not available.

>From bb04e98c00673598f3c21e4d40b208d89fb405cb Mon Sep 17 00:00:00 2001
From: Charles Zablit <c_zablit at apple.com>
Date: Fri, 26 Jun 2026 16:17:46 +0100
Subject: [PATCH] [lldb][Windows] Try falling back to TLS 1.2 before erroring
 out

---
 llvm/lib/HTTP/HTTPClient.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/HTTP/HTTPClient.cpp b/llvm/lib/HTTP/HTTPClient.cpp
index c69aecfa7d619..d92d50a6c1a39 100644
--- a/llvm/lib/HTTP/HTTPClient.cpp
+++ b/llvm/lib/HTTP/HTTPClient.cpp
@@ -310,8 +310,15 @@ Error HTTPClient::perform(const HTTPRequest &Request,
   DWORD SecureProtocols =
       WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_3;
   if (!WinHttpSetOption(Session->SessionHandle, WINHTTP_OPTION_SECURE_PROTOCOLS,
-                        &SecureProtocols, sizeof(SecureProtocols)))
-    return createStringError(errc::io_error, "Failed to set secure protocols");
+                        &SecureProtocols, sizeof(SecureProtocols))) {
+    // Fallback to TLS 1.2 if Windows does not support 1.3.
+    SecureProtocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2;
+    if (!WinHttpSetOption(Session->SessionHandle,
+                          WINHTTP_OPTION_SECURE_PROTOCOLS, &SecureProtocols,
+                          sizeof(SecureProtocols)))
+      return createStringError(errc::io_error,
+                               "Failed to set secure protocols");
+  }
 
   // Disallow redirects in general or HTTPS to HTTP only.
   DWORD RedirectPolicy = WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP;



More information about the llvm-commits mailing list