diff --git a/chromium_src/third_party/crashpad/crashpad/util/net/http_transport_win.cc b/chromium_src/third_party/crashpad/crashpad/util/net/http_transport_win.cc new file mode 100644 index 000000000000..3b6d167b7e01 --- /dev/null +++ b/chromium_src/third_party/crashpad/crashpad/util/net/http_transport_win.cc @@ -0,0 +1,43 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this file, +* You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include +#include +#include + +#include "base/logging.h" + +// Forward declaration. +namespace crashpad { +namespace { +std::string WinHttpMessage(const char* extra); +} +} + +namespace { + +void BraveSetSessionOptions(HINTERNET hSession) { + // Windows 8.1+ already have TLS 1.1 and 1.2 available by default. + if (IsWindows8Point1OrGreater()) + return; + + // Use TLS 1.0, 1.1, or 1.2. + unsigned long secure_protocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; + + // Set protocols and log an error if we can't. Bailing out on the session due + // to an error here is not necessary since if TLS 1.1 or 1.2 is required to + // connect then the connection will fail anyway. + if (!WinHttpSetOption(hSession, WINHTTP_OPTION_SECURE_PROTOCOLS, + &secure_protocols, sizeof(secure_protocols))) { + LOG(ERROR) << crashpad::WinHttpMessage("WinHttpSetOption"); + } +} + +} // namespace + +// The original file is patched to call the above function. +#include "../../../../../../../third_party/crashpad/crashpad/util/net/http_transport_win.cc" + diff --git a/patches/third_party-crashpad-crashpad-util-net-http_transport_win.cc.patch b/patches/third_party-crashpad-crashpad-util-net-http_transport_win.cc.patch new file mode 100644 index 000000000000..66089f9bd63e --- /dev/null +++ b/patches/third_party-crashpad-crashpad-util-net-http_transport_win.cc.patch @@ -0,0 +1,13 @@ +diff --git a/third_party/crashpad/crashpad/util/net/http_transport_win.cc b/third_party/crashpad/crashpad/util/net/http_transport_win.cc +index 2919bc11d0ba4bf84a11e146bf2961b830db35fe..56811eb3e2879e76404c836e6791f8c0ed317595 100644 +--- a/third_party/crashpad/crashpad/util/net/http_transport_win.cc ++++ b/third_party/crashpad/crashpad/util/net/http_transport_win.cc +@@ -153,6 +153,8 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) { + return false; + } + ++ BraveSetSessionOptions(session.get()); ++ + int timeout_in_ms = static_cast(timeout() * 1000); + if (!WinHttpSetTimeouts(session.get(), + timeout_in_ms,