-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8371721: Refactor checkTrusted methods in X509TrustManagerImpl #28275
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back abarashev! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@artur-oracle The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
|
||
| // Logs an info message and always returns false. This method | ||
| // can be used as an OR Predicate to add a log in a stream filter. | ||
| public static boolean logInfo(String option, String s, Object... params) { |
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.
Could you please add tests for this in test/jdk/sun/security/ssl/SSLLogger? loginfo is not hit by the X509Trust manager and could be reused. The tests could be also added to ssl testing, via getHostNameInSNI method
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.
logInfo is being called by X509TrustManagerImpl actually.
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.
Apologies, I meant the tests. getHostNameInSNI itself doesn't seem to be tested either, so there code will never be tested in the current state. Unless there is a test, which I'm just missing
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 just a refactoring PR. Please file a new ticket if you think getHostNameInSNI needs a unit test. I think it's better to keep things separate. Refactoring assumes that no new tests needed. Also not sure if we should test new logging methods, I couldn't find any unit tests for existing logging methods.
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.
Ok, I have created JDK-8371925 . Will push a pr for it after this pr is closed. Thanks!
The 3 checkTrusted methods in X509TrustManagerImpl have a lot of repeating code that can be moved into a helper method.
Also refactoring X509TrustManagerImpl logging code since we are touching this file.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28275/head:pull/28275$ git checkout pull/28275Update a local copy of the PR:
$ git checkout pull/28275$ git pull https://git.openjdk.org/jdk.git pull/28275/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28275View PR using the GUI difftool:
$ git pr show -t 28275Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28275.diff
Using Webrev
Link to Webrev Comment