Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes crash reporting not working on Windows 7. #1292

Merged
merged 1 commit into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 <windows.h>
#include <versionhelpers.h>
#include <winhttp.h>

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

Original file line number Diff line number Diff line change
@@ -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<int>(timeout() * 1000);
if (!WinHttpSetTimeouts(session.get(),
timeout_in_ms,