-
Notifications
You must be signed in to change notification settings - Fork 898
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
Migrate to HttpsFirstMode v2 #17856
Migrate to HttpsFirstMode v2 #17856
Conversation
chromium_src/chrome/browser/ssl/https_upgrades_navigation_throttle.cc
Outdated
Show resolved
Hide resolved
e5886e2
to
23562d2
Compare
23562d2
to
1b31386
Compare
Thanks for the reviews! |
Migrate HTTPS by Default feature to use HttpsFirstMode v2
|
Example |
Example |
Example |
---|---|---|
Verification PASSED on Pixel 6
running Android 14
using the following build(s):
Brave | 1.53.1 Chromium: 113.0.5672.53 (Official Build) canary (32-bit)
--- | ---
Revision | 12f5dac35d12e8f4e72d7dd11df557ef93bc046f-refs/branch-heads/5672@{#703}
OS | Android 13; Build/UPB1.230309.014; 33; UpsideDownCake
Using the STR/Cases outlined via brave/brave-browser#28809 (comment), ensured the following:
- loaded https://anicobin.ldblog.jp/archives/59981055.html and ensured that clicking on the
comment
image loads the page
Example |
Example |
Example |
---|---|---|
Test Case #2
- brave/brave-browser#28935
Verification PASSED on Win 11 x64
using the following build(s):
Brave | 1.52.76 Chromium: 113.0.5672.53 (Official Build) nightly (64-bit)
-- | --
Revision | 12f5dac35d12e8f4e72d7dd11df557ef93bc046f-refs/branch-heads/5672@{#703}
OS | Windows 11 Version 22H2 (Build 22621.1555)
Shields Panel (Upgrade connections to HTTPS
)
Using the STR/Cases mentioned via brave/brave-browser#27141 (comment), went through the following:
- ensured that
Upgrade connections to HTTPS
is selected as the default- ensured that http://insecure.arthuredelstein.net loads without any issues
- ensured that http://http.badssl.com loads without any issues
- ensured that http://upgradable.arthuredelstein.net -> https://upgradable.arthuredelstein.net (should be upgraded)
Example |
Example |
Example |
---|---|---|
Shields Panel (Only connect with HTTPS
)
- visit http://insecure.arthuredelstein.net, http://http.badssl.com and http://upgradable.arthuredelstein.net and ensure that
Only connect with HTTPS
is selected via the shields panel- ensure that http://insecure.arthuredelstein.net displays
The connection to insecure.arthuredelstein.net is not secure
- ensure that
Continue to site
loads http://insecure.arthuredelstein.net without any issues - ensured that http://insecure.arthuredelstein.net loads without any issues after several restarts once
Continue
is selected - ensured that you
Turn on warnings
works as expected via theNot Secure
drop down
- ensure that
- ensure that http://http.badssl.com displays
The connection to http.badssl.com is not secure
- ensure that
Continue to site
loads http://http.badssl.com without any issues - ensured that http://http.badssl.com loads without any issues after several restarts once
Continue
is selected - ensured that you
Turn on warnings
works as expected via theNot Secure
drop down
- ensure that
- ensured that http://upgradable.arthuredelstein.net -> https://upgradable.arthuredelstein.net (should be upgraded)
- ensure that http://insecure.arthuredelstein.net displays
Example |
Example |
Example |
Example |
Example |
Example |
Example |
---|---|---|---|---|---|---|
Shields Panel (Don't upgrade HTTP connections
)
- visit http://insecure.arthuredelstein.net, http://http.badssl.com and http://upgradable.arthuredelstein.net and ensure that
Don't upgrade HTTP connections
is selected via the shields panel- ensure that http://insecure.arthuredelstein.net loads without any issues
- ensure that http://http.badssl.com loads without any issues
- ensured that http://upgradable.arthuredelstein.net doesn't upgrade to
HTTPS
(make sure website loads without issues)- basically ensuring that https://upgradable.arthuredelstein.net doesn't load
Example |
Example |
Example |
---|---|---|
Tor Windows
As per brave/brave-browser#27141 (comment), brave://settings
are isolated on Tor
windows and Strict
should always be used.
- change
Upgrade connections to HTTPS
viabrave://settings
fromStandard
->Disabled
- open a
Tor
window and wait till it connects to the Tor network and you receive theTor connected successfully
message - ensure that http://insecure.arthuredelstein.net displays
The connection to insecure.arthuredelstein.net is not secure
- ensured that
Upgrade connections to HTTPS
settings are not being displayed via the shields panel - ensure that
Continue to site
loads http://insecure.arthuredelstein.net without any issues - ensured that http://insecure.arthuredelstein.net loads without any issues after several restarts once
Continue
is selected - ensured that you
Turn on warnings
works as expected via theNot Secure
drop down
- ensured that
- ensure that http://http.badssl.com displays
The connection to http.badssl.com is not secure
- ensured that
Upgrade connections to HTTPS
settings are not being displayed via the shields panel - ensure that
Continue to site
loads http://http.badssl.com without any issues - ensured that http://http.badssl.com loads without any issues after several restarts once
Continue
is selected - ensured that you
Turn on warnings
works as expected via theNot Secure
drop down
- ensured that
- ensured that http://upgradable.arthuredelstein.net -> https://upgradable.arthuredelstein.net (should be upgraded)
- ensured that
Upgrade connections to HTTPS
settings are not being displayed via the shields panel
- ensured that
Example |
Example |
Example |
---|---|---|
Verification PASSED on Pixel 6
running Android 14
using the following build(s):
Brave | 1.53.1 Chromium: 113.0.5672.53 (Official Build) canary (32-bit)
--- | ---
Revision | 12f5dac35d12e8f4e72d7dd11df557ef93bc046f-refs/branch-heads/5672@{#703}
OS Android 13; Build/UPB1.230309.014; 33; UpsideDownCake
Shields Panel (Upgrade to HTTPS whenever possible (default)
)
- ensured that
Upgrade to HTTPS whenever possible (default)
is selected as the default (if the user hasn't changed anything)- ensured that http://insecure.arthuredelstein.net loads without any issues (shouldn't be upgrading)
- ensured that http://http.badssl.com loads without any issues (shouldn't be upgrading)
- ensured that http://upgradable.arthuredelstein.net -> https://upgradable.arthuredelstein.net (should be upgraded)
Example |
Example |
Example |
Example |
---|---|---|---|
Shields Panel (Require all connections to use HTTPS (strict)
)
- visit http://insecure.arthuredelstein.net, http://http.badssl.com and http://upgradable.arthuredelstein.net and ensure that
Require all connections to use HTTPS (strict)
is selected via the shields panel- ensure that http://insecure.arthuredelstein.net displays
The connection to insecure.arthuredelstein.net is not secure
- ensure that
Continue to site
loads http://insecure.arthuredelstein.net without any issues - ensured that http://insecure.arthuredelstein.net loads without any issues after several restarts once
Continue
is selected - ensured that you
Turn on warnings
works as expected via theNot Secure
drop down
- ensure that
- ensure that http://http.badssl.com displays
The connection to http.badssl.com is not secure
- ensure that
Continue to site
loads http://http.badssl.com without any issues - ensured that http://http.badssl.com loads without any issues after several restarts once
Continue
is selected - ensured that you
Turn on warnings
works as expected via theNot Secure
drop down
- ensure that
- ensured that http://upgradable.arthuredelstein.net -> https://upgradable.arthuredelstein.net (should be upgraded)
- ensure that http://insecure.arthuredelstein.net displays
Example |
Example |
Example |
Example |
Example |
---|---|---|---|---|
Example |
Example |
Example |
Example |
Example |
---|---|---|---|---|
Shields Panel (Don't upgrade connections to HTTPS (disabled)
)
- visit http://insecure.arthuredelstein.net, http://http.badssl.com and http://upgradable.arthuredelstein.net and ensure that
Don't upgrade connections to HTTPS (disabled)
is selected via the shields panel- ensure that http://insecure.arthuredelstein.net loads without any issues
- ensure that http://http.badssl.com loads without any issues
- ensured that http://upgradable.arthuredelstein.net doesn't upgrade to
HTTPS
(make sure website loads without issues)- basically ensuring that https://upgradable.arthuredelstein.net doesn't load
Example |
Example |
Example |
Example |
---|---|---|---|
Prevent permissive HTTPS Upgrade settings from leaking from Normal
to Private
windows
Basically used the STR/Cases outlined via #17421 (comment) and went through the following:
Test Case #1
- Upgrade to HTTPS whenever possible (default)
- visited http://upgradable.arthuredelstein.net in a
Normal
window and ensured thatUpgrade to HTTPS whenever possible (default)
- ensured that
http://upgradable.arthuredelstein.net
->https://upgradable.arthuredelstein.net
- ensured that
- opened a
Private
window and visited http://upgradable.arthuredelstein.net and ensuredUpgrade to HTTPS whenever possible (default)
- ensured that
http://upgradable.arthuredelstein.net
->https://upgradable.arthuredelstein.net
- ensured that
Test Case #2
- Require all connections to use HTTPS (strict)
- visited http://upgradable.arthuredelstein.net and switched HTTPS upgrades to
Require all connections to use HTTPS (strict)
- ensured that
http://upgradable.arthuredelstein.net
->https://upgradable.arthuredelstein.net
- ensured that
- opened a
Private
window and visited http://upgradable.arthuredelstein.net and ensuredRequire all connections to use HTTPS (strict)
- ensured that
http://upgradable.arthuredelstein.net
->https://upgradable.arthuredelstein.net
- ensured that
Test Case #3
- Don't upgrade connections to HTTPS (disabled)
- visited http://upgradable.arthuredelstein.net switched HTTPS upgrades to
Don't upgrade connections to HTTPS (disabled)
- reloaded http://upgradable.arthuredelstein.net and ensured that the website was not being upgraded to HTTPS
- opened a
Private
window and visited http://upgradable.arthuredelstein.net and ensuredUpgrade to HTTPS whenever possible (default)
- ensured that
http://upgradable.arthuredelstein.net
->https://upgradable.arthuredelstein.net
- ensured that
Ensure that Don't upgrade connections to HTTPS (disabled)
is NOT being used
Test Case #4
- Don't upgrade HTTPS connections
(Private Window Only)
- opened a
Private
window and visited http://upgradable.arthuredelstein.net and ensuredUpgrade to HTTPS whenever possible (default)
- ensured that
http://upgradable.arthuredelstein.net
->https://upgradable.arthuredelstein.net
- ensured that
- change the HTTPS upgrade setting to
Don't upgrade connections to HTTPS (disabled)
and loadhttp://upgradable.arthuredelstein.net
Ensure that http://upgradable.arthuredelstein.net
is not upgrade. With this case, we're basically ensuring that you can still use Don't upgrade HTTPS connections
if changed within the Private
window.
Migrate HTTPS by Default feature to use HttpsFirstMode v2
commit c98ff5e Author: brave-builds <[email protected]> Date: Fri Apr 28 08:29:10 2023 +0000 1.51.107 commit ce813ef Author: Max <[email protected]> Date: Fri Apr 28 04:25:41 2023 -0400 Upgrade from Chromium 113.0.5672.53 to Chromium 113.0.5672.63 (1.51.x). (#18269) * Upgrade from Chromium 113.0.5672.53 to Chromium 113.0.5672.63 * Upgrade patches from Chromium 113.0.5672.53 to Chromium 113.0.5672.63 * Update pins list timestamp * Temporarily disables WindowClosingConfirmBrowserTest.TestWithDownload on MacOS. The test fails because in Chromium Private/Incognito profiles now ignore the "Ask for download location" setting and always prompt for the location. We will fix that in brave/brave-browser#29823, but until then let's disable this test on MacOS. --------- Co-authored-by: brave-builds <[email protected]> commit b18aeae Author: brave-builds <[email protected]> Date: Fri Apr 28 10:15:10 2023 +0200 Disable site affiliation fetcher (uplift to 1.51.x) (#18286) Uplift of #18153 (squashed) to release commit 6b1db58 Author: brave-builds <[email protected]> Date: Fri Apr 28 09:47:20 2023 +0200 Revise the behavior of "Extensions (Brave Wallet fallback)" setting (uplift to 1.51.x) (#18228) Uplift of #18172 (squashed) to beta commit f7f8042 Author: brave-builds <[email protected]> Date: Fri Apr 28 09:42:41 2023 +0200 Send kUAModel and kUAPlatformVersion CHs when requested. (uplift to 1.51.x) (#18263) Uplift of #18154 (squashed) to beta commit 545fa57 Author: Max <[email protected]> Date: Fri Apr 28 03:07:51 2023 -0400 Don't call GetSessionRoute() when media router is disabled (#18245) (1.51.x). (#18264) Don't call GetSessionRoute() when media router is disabled (#18245) Otherwise, it would end in reaching NOTREACHED() Co-authored-by: Sangwoo Ko <[email protected]> commit 0fbe592 Author: Arthur Edelstein <[email protected]> Date: Thu Apr 27 17:44:23 2023 -0700 Uplift HTTPS First Mode v2 Migration (#17856) and HTTP error code fallback (#18141) (#18179) * Migrate to HttpsFirstMode v2 (#17856) Migrate HTTPS by Default feature to use HttpsFirstMode v2 * Force HTTPS Upgrader to fall back to HTTP if we have an HTTP error code (#18141) commit e369d71 Author: Aleksey Khoroshilov <[email protected]> Date: Fri Apr 28 03:34:51 2023 +0700 Disable flaky upstream tests. (Uplift to 1.51.x) (#18274) Update nft-details.tsx
Hide network icon commit c98ff5e Author: brave-builds <[email protected]> Date: Fri Apr 28 08:29:10 2023 +0000 1.51.107 commit ce813ef Author: Max <[email protected]> Date: Fri Apr 28 04:25:41 2023 -0400 Upgrade from Chromium 113.0.5672.53 to Chromium 113.0.5672.63 (1.51.x). (#18269) * Upgrade from Chromium 113.0.5672.53 to Chromium 113.0.5672.63 * Upgrade patches from Chromium 113.0.5672.53 to Chromium 113.0.5672.63 * Update pins list timestamp * Temporarily disables WindowClosingConfirmBrowserTest.TestWithDownload on MacOS. The test fails because in Chromium Private/Incognito profiles now ignore the "Ask for download location" setting and always prompt for the location. We will fix that in brave/brave-browser#29823, but until then let's disable this test on MacOS. --------- Co-authored-by: brave-builds <[email protected]> commit b18aeae Author: brave-builds <[email protected]> Date: Fri Apr 28 10:15:10 2023 +0200 Disable site affiliation fetcher (uplift to 1.51.x) (#18286) Uplift of #18153 (squashed) to release commit 6b1db58 Author: brave-builds <[email protected]> Date: Fri Apr 28 09:47:20 2023 +0200 Revise the behavior of "Extensions (Brave Wallet fallback)" setting (uplift to 1.51.x) (#18228) Uplift of #18172 (squashed) to beta commit f7f8042 Author: brave-builds <[email protected]> Date: Fri Apr 28 09:42:41 2023 +0200 Send kUAModel and kUAPlatformVersion CHs when requested. (uplift to 1.51.x) (#18263) Uplift of #18154 (squashed) to beta commit 545fa57 Author: Max <[email protected]> Date: Fri Apr 28 03:07:51 2023 -0400 Don't call GetSessionRoute() when media router is disabled (#18245) (1.51.x). (#18264) Don't call GetSessionRoute() when media router is disabled (#18245) Otherwise, it would end in reaching NOTREACHED() Co-authored-by: Sangwoo Ko <[email protected]> commit 0fbe592 Author: Arthur Edelstein <[email protected]> Date: Thu Apr 27 17:44:23 2023 -0700 Uplift HTTPS First Mode v2 Migration (#17856) and HTTP error code fallback (#18141) (#18179) * Migrate to HttpsFirstMode v2 (#17856) Migrate HTTPS by Default feature to use HttpsFirstMode v2 * Force HTTPS Upgrader to fall back to HTTP if we have an HTTP error code (#18141) commit e369d71 Author: Aleksey Khoroshilov <[email protected]> Date: Fri Apr 28 03:34:51 2023 +0700 Disable flaky upstream tests. (Uplift to 1.51.x) (#18274) Update nft-details.tsx
content::NavigationHandle* handle, | ||
std::unique_ptr<SecurityBlockingPageFactory> blocking_page_factory, | ||
PrefService* prefs) { | ||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are we doing here? Copying code from upstream is the worst of all possible options and we should basically never be doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ticket for this is here: brave/brave-browser#38177
Resolves brave/brave-browser#28935
Resolves brave/brave-browser#28809
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: