Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Existing trust paths can be overwritten, and reused servers can retain stale trust anchors after the client truststore changes.
2 open issues
What changed in this PR
Adds outbound TLS trust for framework-managed certificates, addressing #54140 without disabling certificate validation.
Changes:
- Exports client trust certificates as a provider-neutral PEM bundle.
- Configures server trust paths alongside inbound mTLS settings.
- Adds a server-side HTTPS client integration test.
| File | Description |
|---|---|
| test-framework/tests/src/test/java/org/keycloak/testframework/tests/TlsEnabledTest.java | Tests outbound HTTPS certificate validation. |
| test-framework/core/src/main/java/org/keycloak/testframework/server/AbstractKeycloakServerSupplier.java | Adds managed certificates to server trust configuration. |
| test-framework/core/src/main/java/org/keycloak/testframework/https/ManagedCertificates.java | Exports and exposes the PEM trust bundle. |
Review effort: Balanced
trixpan
force-pushed
the
issue-54140-managed-outbound-trust
branch
from
October 20, 2026 02:28
5d20611 to
beb15a0
Compare
trixpan
force-pushed
the
issue-54140-managed-outbound-trust
branch
from
October 20, 2026 04:24
beb15a0 to
af1903e
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.webauthn.passwordless.WebAuthnPwdLessPropertyTest#timeout |
trixpan
force-pushed
the
issue-54140-managed-outbound-trust
branch
from
October 20, 2026 12:33
af1903e to
b026f07
Compare
This was referenced Oct 20, 2026
Export the managed client truststore as a PEM bundle and add it to the server truststore paths when TLS is enabled. Keycloak keeps only the last repeated CLI option, so truststore paths are merged into a single list value that preserves paths configured by tests or interceptors. Comma-containing arguments are quoted when launching kc.bat, as cmd.exe would otherwise split them. Verify the server-side HTTP client can connect to the managed HTTPS endpoint without disabling certificate validation, and that the server truststore contains both test-configured and managed certificates. Point the non-strict FIPS job at the JDK cacerts as JKS. RH OpenJDK ships cacerts as JKS, but merging the default truststore assumes PKCS12, which BCFIPS rejects in non-strict mode (keycloak#28526). Closes keycloak#54140 Co-Authored-By: OpenAI Codex <noreply@openai.com> Signed-off-by: Andre F de Miranda <trixpan@users.noreply.github.com>
trixpan
force-pushed
the
issue-54140-managed-outbound-trust
branch
from
November 26, 2026 23:02
b026f07 to
0459f23
Compare
| null, managedCert.getServerTrustStorePath(), managedCert.getKeystoreFormat().name()))) { | ||
| // for PEM file use common truststore paths option | ||
| command.option("truststore-paths", managedCert.getServerTrustStorePath()); | ||
| command.addOption("truststore-paths", managedCert.getServerTrustStorePath()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Closes #54140
Summary
truststore-paths.truststore-pathslist value, including the PEM mTLS truststore.kc.baton Windows, ascmd.exewould otherwise split them.cacertsas JKS. RH OpenJDK shipscacertsas JKS, but merging the default truststore assumes PKCS12, which BCFIPS rejects in non-strict mode oncetruststore-pathsis set (Truststore consolidation broke keycloak fips mode #28526).The PEM bundle is provider-neutral input to
truststore-paths; Keycloak converts it to the active provider's preferred generated truststore format, including BCFKS in strict FIPS mode.Testing
./mvnw package -f test-framework/pom.xmlKC_TEST_SERVER=embedded ./mvnw package -f test-framework/tests/pom.xml -Dtest=CustomConfigTest,RunOnServerTest,TlsEnabledTest./mvnw spotless:check -pl test-framework/core,test-framework/testsAI assistance
This PR was developed with assistance from OpenAI Codex. I reviewed and understand the submitted changes.