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

Fix #10607: Show warnings for TLS 1.0 and TLS 1.1 (uplift to 1.15.x) #6616

Merged
merged 1 commit into from
Sep 11, 2020
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
2 changes: 2 additions & 0 deletions app/brave_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "google_apis/gaia/gaia_switches.h"
#include "net/base/features.h"
#include "services/device/public/cpp/device_features.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
Expand Down Expand Up @@ -202,6 +203,7 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) {
// Upgrade all mixed content
blink::features::kMixedContentAutoupgrade.name,
password_manager::features::kPasswordImport.name,
net::features::kLegacyTLSEnforced.name,
// Remove URL bar mixed control and allow site specific override instead
features::kMixedContentSiteSetting.name,
// Warn about Mixed Content optionally blockable content
Expand Down
2 changes: 2 additions & 0 deletions app/brave_main_delegate_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "content/public/common/web_preferences.h"
#include "content/public/test/browser_test.h"
#include "gpu/config/gpu_finch_features.h"
#include "net/base/features.h"
#include "services/device/public/cpp/device_features.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
Expand Down Expand Up @@ -86,6 +87,7 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, EnabledFeatures) {
&features::kWinrtGeolocationImplementation,
#endif
&omnibox::kOmniboxContextMenuShowFullUrls,
&net::features::kLegacyTLSEnforced,
};

for (const auto* feature : enabled_features)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Copyright (c) 2020 The Brave Authors. All rights reserved.
* 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 "chrome/browser/component_updater/tls_deprecation_config_component_installer.h"

#define ReconfigureAfterNetworkRestart \
ReconfigureAfterNetworkRestart_ChromiumImpl
#include "../../../../../chrome/browser/component_updater/tls_deprecation_config_component_installer.cc" // NOLINT
#undef ReconfigureAfterNetworkRestart

#include "base/bind.h"
#include "chrome/browser/browser_process.h"
#include "content/public/browser/browser_thread.h"
#include "services/network/public/proto/tls_deprecation_config.pb.h"

namespace component_updater {

namespace {

std::string LoadEmptyConfig() {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::WILL_BLOCK);
auto config =
std::make_unique<chrome_browser_ssl::LegacyTLSExperimentConfig>();
config->set_version_id(1);
return config->SerializeAsString();
}

} // namespace

// static
void TLSDeprecationConfigComponentInstallerPolicy::
ReconfigureAfterNetworkRestart() {
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::MayBlock()},
base::BindOnce(&LoadEmptyConfig),
base::BindOnce(&UpdateLegacyTLSConfigOnUI));
}

} // namespace component_updater
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* Copyright (c) 2020 The Brave Authors. All rights reserved.
* 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/. */

#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_COMPONENT_UPDATER_TLS_DEPRECATION_CONFIG_COMPONENT_INSTALLER_H_
#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_COMPONENT_UPDATER_TLS_DEPRECATION_CONFIG_COMPONENT_INSTALLER_H_

#define ReconfigureAfterNetworkRestart \
ReconfigureAfterNetworkRestart_ChromiumImpl(); \
static void ReconfigureAfterNetworkRestart
#include "../../../../../chrome/browser/component_updater/tls_deprecation_config_component_installer.h"
#undef ReconfigureAfterNetworkRestart

#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_COMPONENT_UPDATER_TLS_DEPRECATION_CONFIG_COMPONENT_INSTALLER_H_