-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8350582: Correct the parsing of the ssl value in javax.net.debug #23781
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
Conversation
|
👋 Welcome back coffeys! A progress list of the required criteria for merging this PR into |
|
@coffeys 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 227 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. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
|
Thanks for the feedback @myankelev - changes incorporated |
Thanks, LGTM |
| "adding as trusted certificates", | ||
| "supported_versions"), | ||
| null), | ||
| // ssl should print most details expect verbose details |
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.
nit: expect -> except
| "trigger seeding of SecureRandom", | ||
| "supported_versions"), | ||
| List.of("Plaintext before ENCRYPTION")), | ||
| // ssltypo contains "ssl". Treat like "ssl" |
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.
This is surprising behavior. We want it to behave as if there was no suffix after ssl?
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.
yes, the javax.net.debug property doesn't specify any delimiter between options. Quite strange. It's also had the historical behaviour of printing all ssl details once the string property contains "ssl" with the exception that "sslctx" may be present.
Might target more behavioural changes via the JDK-8044609 parent bug but for now, this patch is mimimal to aid backporting to update releases.
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.
Nit: copyright year update
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.
Suggest we add verifying debug output when setting different javax.net.debug properties to the test summary.
|
@coffeys 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! |
bradfordwetmore
left a comment
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.
Depending on the followup discussion of what ssl alone means.
However, several suggestions below, one might help with test coverage. If you take some/all, then I'll review again. Should be quick.
| /** | ||
| * @test | ||
| * @bug 8350582 | ||
| * @library /test/lib /javax/net/ssl/templates ../../ |
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.
Is ../.. actually needed?
It ran fine in another test directory several levels below this one.
| } | ||
|
|
||
| private static Stream<Arguments> patternMatches() { | ||
| // "Plaintext before ENCRYPTION" comes from "ssl:record:plaintext" option |
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.
Minor nits. >= 80 chars in some lines.
You could leave as is, or shorten the searched-for message. I'm ok if you really want to leave, as I don't expect lots of changes in this file. (horizontal scrolling during reviews is my pet peeve)
Or you could do:
Produced ClientHello handshake message
->
Produced ClientHello handshake
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.
A suggestion that could ease/increase test coverage:
HashMap<String, String> masterMap = new HashMap<>();
// add one <String, String> for each output category.
masterMap.put("handshake", "Produced ClientHello handshake message");
// ...
// for each testcase {
// missing = clone masterMap; // start with the full map
// required = new HashMap(); // create an empty map
// for each key in the test case {
// missing.remove(value);
// required.add(value);
// }
// runTest();
// check each value String in required is present
// check each value String in missing is not
// }
You can then easily add test cases with:
test("ssl","handshake"); // use "..." params if you don't want to do String parsing, and have multiple params
| * @test | ||
| * @bug 8350582 | ||
| * @library /test/lib /javax/net/ssl/templates ../../ | ||
| * @summary Verify debug output for different javax.net.debug scenarios |
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.
Isn't the summary supposed to match the bugid's description?
| } | ||
| } | ||
|
|
||
| public static void main(String[] args) throws Exception { |
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.
Is this here because for running outside of jtreg, say via the command line?
|
Thanks for your review @bradfordwetmore - I've fixed up the test case as per your review comments. Breaking the test output logic into two maps sounds attractive but the logic isn't mutually exclusive for some of our debug options. In fact, the debug logic for sub-components is still broken and should be fixed up in the follow on 8044609 bug fix. The logger implementation is at odds with our help and docs menu. I have used a map to test for good/bad patterns but I've left the keys for those maps as user defined. this fixes up special handling of the "ssl" option and restores it to the older TLSv1.2 stack approach. |
bradfordwetmore
left a comment
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 addressing the other issues in the test e.g. main, ../.., and bug description.
In looking at the proposed test for this issue, what I was thinking of is actually a mix of 8350582 and future bug JDK-8044609 which cleans up the cat/subcats assignments.
This bug only handles the ssl change, so I'm thinking we should change the regtest for this bug to be a simple test looking for the effects of ssl with no data/verbose/plaintext/packet output, and move (or update) this more general test to be done for 8044609.
Thoughts?
| "certpath: Cert path validation succeeded")); | ||
| debugMessages.put("logger", | ||
| List.of("FINE: adding as trusted certificates", | ||
| "FINE: WRITE: TLSv1.3 application_data")); |
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.
Missing a few more test cases for the more general test case.
session -> Session initialized:
packet -> Raw write
defaultctx -> (may not be able to add if you're using non-default contexts)
verbose -> Ignore unsupported cipher suite:
Thanks for comments Brad. I've added extra component areas to the test. JDK-8044609 will bring in further clean up. Given that we've zero test coverage in this area today, I think it's important/useful to have a test that reflects what the code is doing today. Some behaviour is broken I'd argue (and conflicts with our docs and help menus) The test can be modified further with the JDK-8044609 changes. It'll also help give us a better picture around impact of upcoming changes. For that reason, I'd like to keep the current test coverage. |
bradfordwetmore
left a comment
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.
We never did hear from Xuelei, so will go with our best guess, which is that that change introduced a bug, and was not an intentional reversal of behavior as I initially believed.
I approve this PR with the strong urging that JDK-8044609 can be fixed in JDK 25, and hopefully backported together. That change should be able to be reviewed quickly, now that we are past this big issue.
|
Thanks Brad - I plan to sync JDK-8044609 PR up with latest changes and restart work on it shortly. /integrate |
|
Going to push as commit 1ec6481.
Your commit was automatically rebased without conflicts. |
Breaking the parent JDK-8044609 JBS issue into sub tasks.
This patch addresses the main issue which is that
javax.net.debug=ssloption is completely broken since TLSv1.3 support was introduced. This patch should be easier for backporting also.Wider corrections can be followed up via parent bug.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23781/head:pull/23781$ git checkout pull/23781Update a local copy of the PR:
$ git checkout pull/23781$ git pull https://git.openjdk.org/jdk.git pull/23781/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23781View PR using the GUI difftool:
$ git pr show -t 23781Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23781.diff
Using Webrev
Link to Webrev Comment