Skip to content

Conversation

@artur-oracle
Copy link
Member

@artur-oracle artur-oracle commented Nov 12, 2025

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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8371721: Refactor checkTrusted methods in X509TrustManagerImpl (Enhancement - P5)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28275/head:pull/28275
$ git checkout pull/28275

Update a local copy of the PR:
$ git checkout pull/28275
$ git pull https://git.openjdk.org/jdk.git pull/28275/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28275

View PR using the GUI difftool:
$ git pr show -t 28275

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28275.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 12, 2025

👋 Welcome back abarashev! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 12, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Nov 12, 2025

@artur-oracle The following label will be automatically applied to this pull request:

  • security

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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 12, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 12, 2025

Webrevs


// 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) {
Copy link
Member

@myankelev myankelev Nov 13, 2025

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

Copy link
Member Author

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.

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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!

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

Labels

rfr Pull request is ready for review security [email protected]

Development

Successfully merging this pull request may close these issues.

2 participants