Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Headless Chrome retains the broad certificate-error bypass, so trust is not restricted to the managed key.
1 open issue
What changed in this PR
Adds managed-certificate SPKI configuration to Chrome WebDriver sessions, addressing #54091 without modifying host trust stores.
Changes:
- Exposes the managed server certificate’s SHA-256 SPKI hash.
- Passes the hash to Chrome and Chrome Headless.
- Adds certificate-hash and Chrome-options tests.
| File | Description |
|---|---|
| test-framework/ui/src/main/java/org/keycloak/testframework/ui/webdriver/DriverUtils.java | Builds and applies TLS arguments. |
| test-framework/ui/src/main/java/org/keycloak/testframework/ui/webdriver/ChromeWebDriverSupplier.java | Injects managed certificates into Chrome setup. |
| test-framework/ui/src/main/java/org/keycloak/testframework/ui/webdriver/ChromeHeadlessWebDriverSupplier.java | Injects managed certificates into headless setup. |
| test-framework/tests/src/test/java/org/keycloak/testframework/ui/webdriver/DriverOptionsTest.java | Tests TLS-dependent Chrome arguments. |
| test-framework/tests/src/test/java/org/keycloak/testframework/tests/TlsEnabledTest.java | Checks the hash against the HTTPS certificate. |
| test-framework/core/src/main/java/org/keycloak/testframework/https/ManagedCertificates.java | Exports the server certificate’s SPKI hash. |
Review effort: Balanced
| ChromeOptions options = DriverOptions.createChromeOptions(headless); | ||
| options.addArguments(extraArguments); |
There was a problem hiding this comment.
Fixed in dceef13. Headless Chrome no longer receives the broad --ignore-certificate-errors bypass; managed TLS now relies only on the certificate-scoped SPKI exception. DriverOptionsTest also asserts that the broad bypass is absent. Verified with ./mvnw -o -pl test-framework/tests -Dtest=DriverOptionsTest test (2 tests, 0 failures).
db1c440 to
dceef13
Compare
dceef13 to
40cf5e6
Compare
Chrome treated the managed self-signed server certificate as an error (--ignore-certificate-errors), so pages served over the TLS test server were not secure contexts and secure-context-only features were disabled. Pin the managed server certificate via --ignore-certificate-errors-spki-list, matching the leaf-trust model the managed Java clients already use. Closes keycloak#54091 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Andre F de Miranda <trixpan@users.noreply.github.com>
40cf5e6 to
4406b5d
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Real Chromium 152+ validation is needed because existing tests cover SPKI and command-line options but do not establish that the scoped exception preserves authenticated TLS state and enables DBSC header processing.
Review effort: Balanced

Closes #54091
Summary
ManagedCertificates.--ignore-certificate-errors-spki-list.Testing
This keeps trust scoped to the generated test certificate and does not modify the host trust store.