Skip to content

Conversation

joerg1985
Copy link
Member

This PR is related to #11798 UnreachableBrowserException caused by "connection closed locally" exactly 3 minutes after session start when using JDK HttpClient.

Description

There seems to be a bug in the JDK related to redirects, see https://bugs.openjdk.org/browse/JDK-8304701
This PR will disable the redirects of the JDK HttpClient and add a custom handling of redirects.

Additionally this PR will:

  • ensure there is no downgrade of redirected POST requests to GET requests, see javadoc of java.net.http.HttpClient.Redirect
  • ensure there is no downgrade from a secure URL to an insecure URL

I am not sure if this will fix the original issue described in #11798, so there is additional testing needed.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, left some comments.

@titusfortner
Copy link
Member

fyi, a mysterious @joerg1985 got a shout out in the State of the Union address at the Selenium Conference last week...
Thanks for your work!

20230329_092108

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @joerg1985!

@diemol diemol merged commit ca50360 into SeleniumHQ:trunk Apr 4, 2023
yashcho pushed a commit to yashcho/selenium that referenced this pull request Apr 7, 2023
Handle redirects inside the JdkHttpClient

Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
valfirst added a commit to vividus-framework/vividus that referenced this pull request Apr 23, 2023
Reason: mobile web tests (iPad) fail on SauceLabs.
Assumption: regression issue was introduced in Selenium 4.9.0 (possible root cause: SeleniumHQ/selenium#11816)
valfirst added a commit to vividus-framework/vividus that referenced this pull request Apr 23, 2023
Reason: mobile web tests (iPad) fail on SauceLabs.
Assumption: regression issue was introduced in Selenium 4.9.0 (possible root cause: SeleniumHQ/selenium#11816)
valfirst added a commit to vividus-framework/vividus that referenced this pull request Apr 24, 2023
Reason: mobile web tests (iPad) fail on SauceLabs.
Assumption: regression issue was introduced in Selenium 4.9.0 (possible root cause: SeleniumHQ/selenium#11816)
@Artur-
Copy link
Contributor

Artur- commented May 19, 2023

This commit causes our several of our Saucelabs based builds to fail when going from Selenium 4.8.3 to 4.9.0. Running with 4.9.0 + this reverted makes everything work again.

The errors are timeouts creating drivers or org.openqa.selenium.WebDriverException: Invalid message: ERROR Internal Server Error or Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Handshake response does not match any supported protocol (which might be that same but obfuscated because of #11927)

@diemol
Copy link
Member

diemol commented May 19, 2023

Can you create an issue about this, please?

@Artur-
Copy link
Contributor

Artur- commented May 19, 2023

#12069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants