GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Show certificates from truststore in SSL info endpoint by garvit-joshi · Pull Request #48967 · spring-projects/spring-boot

Conversation

@garvit-joshi

@garvit-joshi garvit-joshi commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Adds trustStoreCertificateChains field to BundleInfo to expose truststore certificates separately from keystore certificates in the SSL info endpoint.

Closes #45845

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@garvit-joshi
Show certificates from truststore in SSL info endpoint
b283e21
Signed-off-by: Garvit Joshi <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. label Jan 26, 2026
@mhalbritter mhalbritter self-assigned this Jan 28, 2026
@mhalbritter mhalbritter mentioned this pull request Jan 28, 2026
Show certificates from truststore in SSL info endpoint #45845
Closed
@mhalbritter mhalbritter added type: enhancement A general enhancement and removed status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. labels Jan 28, 2026
@mhalbritter mhalbritter added this to the 4.1.x milestone Jan 28, 2026
@mhalbritter

mhalbritter commented Jan 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Hello @garvit-joshi,

thanks for the PR. I played around with it a bit, and while this works when the truststore has "Private Key" entries in it (secret key + certificate), it fails when a truststore only contains "Trusted Certificate" entries.

The reason is that KeyStore.getCertificateChain only works for "Private Key" entries, as stated in the JavaDoc:

Returns the certificate chain associated with the given alias. The certificate chain must have been associated with the alias by a call to setKeyEntry, or by a call to setEntry with a PrivateKeyEntry.

To get the (leaf) certificate for a "Trusted Certificate" entry, you'd need to call KeyStore.getCertificate. Hoewever, this will only give you the leaf certificate (the last one in the chain). So either we rename trustStoreCertificateChains to trustStoreCertificates or we need to go the hard route of getting the complete chain for a truststore "Trusted Certificate" entry.

You can use those two keystores to play around, the passwords for both the keystore and the private keys is secret. The keystore contains "Private Key" entries, while the truststore contains "Trusted Certificate" entries (I haven't put in the work to really create a chain of trust, it's all self-signed certificates without a real chain).

We should also verify that it works with a test which doesn't reuse the keystore as the truststore.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhalbritter mhalbritter added the status: waiting-for-feedback We need additional information before we can continue label Jan 28, 2026
@garvit-joshi
Handle trustedCertEntry in truststore and add separate keystore/trust…
c3bdfc6
…store tests

Signed-off-by: Garvit Joshi <[email protected]>
@garvit-joshi

garvit-joshi commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

Hi @mhalbritter,

Thank you for the detailed feedback and for providing the test keystores!

I've updated the implementation to handle trustedCertEntry entries. The code now first tries getCertificateChain() for PrivateKeyEntry entries, and falls back to getCertificate() for trustedCertEntry entries.

I've also added a new test separateKeyStoreAndTrustStoreShouldProvideSslInfo() that uses separate keystore (with 2 PrivateKeyEntry entries) and truststore (with 3 trustedCertEntry entries) to verify both scenarios work correctly.

Thanks again for your guidance!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 29, 2026
@garvit-joshi
Formatted the tests
0749324
Signed-off-by: Garvit Joshi <[email protected]>
@garvit-joshi

garvit-joshi commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

Build got failed due to formatting issues. I have formatted the required files.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

garvit-joshi added a commit to garvit-joshi/pr-48967 that referenced this pull request Feb 2, 2026
@garvit-joshi
Test for PR #48967: Show certificates from truststore in SSL info end…
ff47a52
…point

This project demonstrates the functionality added in spring-projects/spring-boot#48967,
which exposes truststore certificates through the SSL info actuator endpoint.

The /actuator/info endpoint now includes:
- Certificate chains with alias, issuer, subject, and validity info
- Truststore certificates with the same detailed information
- Support for multiple SSL bundles
@garvit-joshi

garvit-joshi commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

Hi @mhalbritter,
I've created a small test project to verify the fix works correctly with the keystores you provided: https://github.com/garvit-joshi/pr-48967

The SSL info endpoint now correctly returns:

  • certificateChains: 2 entries from keystore (PrivateKeyEntry)
  • trustStoreCertificates: 3 entries from truststore (trustedCertEntry)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhalbritter mhalbritter removed the status: feedback-provided Feedback has been provided label Feb 6, 2026
mhalbritter pushed a commit that referenced this pull request Feb 6, 2026
@garvit-joshi @mhalbritter
Show certificates from truststore in SSL info endpoint
e1a1d0e
See gh-48967

Signed-off-by: Garvit Joshi <[email protected]>
mhalbritter added a commit that referenced this pull request Feb 6, 2026
@mhalbritter
Polish "Show certificates from truststore in SSL info endpoint"
27b9402
See gh-48967
@mhalbritter mhalbritter closed this in 472031e Feb 6, 2026
@mhalbritter

mhalbritter commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Thanks @garvit-joshi !

garvit-joshi reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhalbritter mhalbritter modified the milestones: 4.1.x, 4.1.0-M2 Feb 6, 2026
@tommyk-gears tommyk-gears mentioned this pull request Feb 25, 2026
Monitor certificates from truststore in SslMeterBinder #49325
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mhalbritter mhalbritter

Labels

type: enhancement A general enhancement

Projects

None yet

Milestone

4.1.0-M2

Development

Successfully merging this pull request may close these issues.

Show certificates from truststore in SSL info endpoint

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@garvit-joshi @mhalbritter @spring-projects-issues
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.