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

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 09:56:10 PDT 2026


Author: Charles Zablit
Date: 2026-06-26T17:56:06+01:00
New Revision: 994af34de8865aa46f5b6bc883f26dc5a10ed846

URL: https://github.com/llvm/llvm-project/commit/994af34de8865aa46f5b6bc883f26dc5a10ed846
DIFF: https://github.com/llvm/llvm-project/commit/994af34de8865aa46f5b6bc883f26dc5a10ed846.diff

LOG: [lldb][Windows] Try falling back to TLS 1.2 before erroring out (#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.

Added: 
    

Modified: 
    llvm/lib/HTTP/HTTPClient.cpp

Removed: 
    


################################################################################
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