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

Fallback to HTTP when an upgraded site sees 404 etc #28013

Closed
arthuredelstein opened this issue Jan 24, 2023 · 5 comments · Fixed by brave/brave-core#18141
Closed

Fallback to HTTP when an upgraded site sees 404 etc #28013

arthuredelstein opened this issue Jan 24, 2023 · 5 comments · Fixed by brave/brave-core#18141

Comments

@arthuredelstein
Copy link

arthuredelstein commented Jan 24, 2023

As an improvement to #27141, can we detect when a site that has been upgraded to HTTPS from HTTP shows a top-level error code such as 404? In that case, we should fall back to HTTP again.

For QA testing:

We will direct the browser to visit a non-existent page over HTTP. The browser will attempt HTTPS behind the scenes, and when it gets a 404 code, it should automatically fall back to HTTP.

  1. Enter http://upgradable.arthuredelstein.net/nonexistent.html in the address bar (or click on the link).
  2. Here are two possible results:
  • PASS: Final page shows a 404 error and uses http:// in the address bar.
  • FAIL: Final page shows a 404 error and uses https:// in the address bar.

(This change landed in 1.52.60)

@arthuredelstein arthuredelstein added OS/Android Fixes related to Android browser functionality OS/Desktop labels Jan 24, 2023
@arthuredelstein arthuredelstein self-assigned this Jan 24, 2023
@pes10k
Copy link
Contributor

pes10k commented Jan 24, 2023

cc @goodov @iefremov @bridiver we might need your help or guidance in how to do this in a chromium-friendly way

@goodov
Copy link
Member

goodov commented Jan 25, 2023

I think in most cases the connection will just fail. We can detect this by expecting an error page (in a throttle?), check if the http->https change was made by us and reverse it.

We can also add some info/button to the error page to return to http if a user wants this explicitly, i.e. not do this automatically.

@kjozwiak
Copy link
Member

The above requires 1.51.107 or higher for 1.51.x verification 👍

@stephendonner
Copy link

stephendonner commented Apr 29, 2023

Verified PASSED using

Brave 1.51.107 Chromium: 113.0.5672.63 (Official Build) (x86_64)
Revision 0e1a4471d5ae5bf128b1bd8f4d627c8cbd55f70c-refs/branch-heads/5672@{#912}
OS macOS Version 13.4 (Build 22F5049e)

Steps:

  1. installed 1.51.107
  2. launched Brave
  3. loaded http://upgradable.arthuredelstein.net/nonexistent.html
  4. clicked on the Shields icon to note the settings
  5. confirmed I got an HTTP 404 error
  6. confirmed I remained on http://upgradable.arthuredelstein.net/nonexistent.html
  7. clicked to toggle Upgrade connections to HTTPS to Only connect with HTTPS
  8. confirmed I remained on http://upgradable.arthuredelstein.net/nonexistent.html
  9. confirmed Continue to site and Go back buttons, which worked
example example example example
Screenshot 2023-04-29 at 3 18 40 AM Screenshot 2023-04-29 at 3 19 11 AM Screenshot 2023-04-29 at 3 20 13 AM Screenshot 2023-04-29 at 3 30 45 AM

Verification PASSED on

Brave | 1.51.107 Chromium: 113.0.5672.63 (Official Build) (64-bit)
-- | --
Revision | 0e1a4471d5ae5bf128b1bd8f4d627c8cbd55f70c-refs/branch-heads/5672@{#912}
OS | Windows 10 Version 21H2 (Build 19044.2846)

Steps:

  1. installed 1.51.107
  2. launched Brave
  3. loaded http://upgradable.arthuredelstein.net/nonexistent.html
  4. clicked on the Shields icon to note the settings
  5. confirmed I got an HTTP 404 error
  6. confirmed I remained on http://upgradable.arthuredelstein.net/nonexistent.html
  7. clicked to toggle Upgrade connections to HTTPS to Only connect with HTTPS
  8. confirmed I remained on http://upgradable.arthuredelstein.net/nonexistent.html
  9. confirmed Continue to site and Go back buttons, which worked
example example example example
image image image image

Verification passed on

Brave 1.51.107 Chromium: 113.0.5672.63 (Official Build) (64-bit)
Revision 0e1a4471d5ae5bf128b1bd8f4d627c8cbd55f70c-refs/branch-heads/5672@{#912}
OS Ubuntu 18.04 LTS
image image

@kjozwiak
Copy link
Member

kjozwiak commented May 1, 2023

Verification PASSED on Pixel 6 running Android 14 using the following build(s):

Brave | 1.51.107 Chromium: 113.0.5672.63 (Official Build) (32-bit)
--- | ---
Revision | 0e1a4471d5ae5bf128b1bd8f4d627c8cbd55f70c-refs/branch-heads/5672@{#912}
OS | Android 13; Build/UPB1.230309.014; 33; UpsideDownCake

Went through the STR/Cases outlined via #28013 (comment) and ensured everything was working as expected:

Example Example Example Example Example
Screenshot_20230501-012428 Screenshot_20230501-012441 Screenshot_20230501-012505 Screenshot_20230501-012510 Screenshot_20230501-012543

Verification PASSED on Samsung Galaxy Tab S8 Ultra running Android 13 using the following build(s):

Brave | 1.51.107 Chromium: 113.0.5672.63 (Official Build) (32-bit)
--- | ---
Revision | 0e1a4471d5ae5bf128b1bd8f4d627c8cbd55f70c-refs/branch-heads/5672@{#912}
OS | Android 13; Build/TP1A.220624.014; 33; REL

Went through the STR/Cases outlined via #28013 (comment) and ensured everything was working as expected:

Example Example Example Example Example
Screenshot_20230501_013024_Brave Screenshot_20230501_013033_Brave Screenshot_20230501_013047_Brave Screenshot_20230501_013057_Brave Screenshot_20230501_013101_Brave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment