-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8282600: SSLSocketImpl should not use user_canceled workaround when not necessary #7664
Conversation
…has already half-closed the connection.
👋 Welcome back zzambers! A progress list of the required criteria for merging this PR into |
@zzambers I've create https://bugs.openjdk.java.net/browse/JDK-8282600 for this issue. Please reference it in the PR title. |
@jerboaa thank you |
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.
It looks like a nice change to me. Thank you!
@zzambers This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 760 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@XueleiFan, @bradfordwetmore) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Did you want to add a test? Otherwise, please add a noreg- label in the bug JDK-8282600. |
@XueleiFan thank you for review. I have added noreg-external tag and some explanation to Openjdk bug. |
I am looking at a few things in this PR. Please ping me before integrating. I believe this code is correct, but checking on the overall USER_CANCELED strategy. |
@bradfordwetmore, it is ready from my side, but please take your time to do any checks, which you find necessary to make sure there is no problem here. |
Thanks, been working on another close issue. I should be finishing that shortly, |
@zzambers This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Resettting the clock. Sorry for the delay. |
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.
Thanks for the extra time to review this change.
I'm still wondering if there is better pattern that doesn't use user_canceled, but that doesn't need to delay this fix from going in.
tier1/tier2 tests pass. Did not try infra or JCK yet. |
Infra + JCK passed. Looks good. |
@bradfordwetmore Thank you |
/integrate |
/sponsor |
Going to push as commit 7e88ff8.
Your commit was automatically rebased without conflicts. |
When testing compatibility of jdk TLS implementation with gnutls, I have found a problem. The problem is, that gnutls does not like use of user_canceled alert when closing TLS-1.3 connection from duplexCloseOutput() (used by socket.close() unless shutdownOutput was called explicitly) and considers it error. (For more details see: [1])
As I understand it, usage of user_canceled alert before close is workaround for an issue of not being able to cleanly initialize full (duplex) close of TLS-1.3 connection (other side is not required to immediately close the after receiving close_notify, unlike in earlier TLS versions). Some legacy programs could probably hang or something, expecting socket.close to perform immediate duplex close. Problem is this is not what user_canceled alert is intended for [2] and it is therefore undefined how the other side handles this. (JDK itself replies to close_notify preceded by user_canceled alert by immediately closing its output [3].)
This fix disables this workaround when it is not necessary (connection is already half-closed by the other side). This way it fixes my case (gnutls client connected to jdk server initiates close) and it should be safe. (As removing workaround altogether could probably reintroduce issues for legacy apps... )
I also ran jdk_security tests locally, which passed for me.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1918473
[2] https://datatracker.ietf.org/doc/html/rfc8446#section-6.1
[3]
jdk/src/java.base/share/classes/sun/security/ssl/Alert.java
Line 243 in b6c35ae
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7664/head:pull/7664
$ git checkout pull/7664
Update a local copy of the PR:
$ git checkout pull/7664
$ git pull https://git.openjdk.java.net/jdk pull/7664/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7664
View PR using the GUI difftool:
$ git pr show -t 7664
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7664.diff