8000 Keep custom HTTPS truststore type when a PEM server certificate is configured by gaurav0107 · Pull Request #55501 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Keep custom HTTPS truststore type when a PEM server certificate is configured - #55501

Merged
shawkins merged 1 commit into
keycloak:mainfrom
gaurav0107:fix/55500-pem-server-identity-suppresses-custom
Dec 4, 2026
Merged

shawkins merged 1 commit into
keycloak:mainfrom
gaurav0107:fix/55500-pem-server-identity-suppresses-custom

Conversation

@gaurav0107
Copy link
Copy Markdown
Contributor

Closes #55500

Decisions and assumptions:

  • The PEM server certificate precedence check in filterOtherStoreType now only applies to the key store, matching dispatchStoreFile and dispatchStoreProperty, which already gate it on StoreRole.KEY_STORE.
  • filterOtherStoreType takes an explicit StoreRole instead of inferring it, so the HTTPS and management call sites state which store they map.
  • Key store behaviour is unchanged: a PEM server certificate still takes precedence over an OTHER-type key store.

This change was drafted with the help of an AI agent (Claude Code).

@stianst stianst added team/cloud-native kind/bug Categorizes a PR related to a bug and removed team/core-shared labels Nov 26, 2026
@gaurav0107
gaurav0107 marked this pull request as ready for review November 29, 2026 11:00
@gaurav0107
gaurav0107 requested review from a team as code owners November 29, 2026 11:00
Copilot AI balanced review requested due to automatic review settings November 29, 2026 11:00
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change preserving custom HTTPS and management TLS truststore types.

No open issues 🎉

What changed in this PR

Fixes #55500 by preserving custom HTTPS truststore types, such as JCEKS, when a PEM server certificate is configured. The change applies to both HTTPS and management TLS configuration while retaining PEM precedence for key stores.

Changes:

  • Makes the store role explicit when filtering custom store types.
  • Restricts PEM precedence checks to key stores.
  • Adds regression tests for HTTPS truststores and inherited management truststores.
File Description
quarkus/​runtime/​src/​test/​java/​org/​keycloak/​quarkus/​runtime/​configuration/​mappers/​TlsStoreDispatchTest.java Adds PEM/custom-truststore regression tests and updates helper calls.
quarkus/​runtime/​src/​main/​java/​org/​keycloak/​quarkus/​runtime/​configuration/​mappers/​ManagementPropertyMappers.java Passes explicit roles for management key stores and truststores.
quarkus/​runtime/​src/​main/​java/​org/​keycloak/​quarkus/​runtime/​configuration/​mappers/​HttpPropertyMappers.java Limits PEM-based type suppression to key stores.

Review effort: Balanced

…nfigured

The PEM certificate check in filterOtherStoreType is only meant to let a PEM server identity take precedence over a key store. It was also applied to the truststore, so trust-store.other.type was dropped while the path and password were still mapped, failing startup for types such as JCEKS.

Closes keycloak#55500

Signed-off-by: Gaurav Dubey <gauravdubey0107@gmail.com>
@shawkins
shawkins force-pushed the fix/55500-pem-server-identity-suppresses-custom branch from 79cb699 to 9a7ec05 Compare December 2, 2026 15:33
Copilot AI balanced review requested due to automatic review settings December 2, 2026 15:33
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change preserving custom HTTPS truststore types when PEM certificates are configured.

No open issues 🎉

Review effort: Balanced

@shawkins shawkins left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @gaurav0107, LGTM

@gaurav0107
Copy link
Copy Markdown
Contributor Author

Thanks for the review and approval, @shawkins!