Rotate TLS certificate chains without breaking Java clients
Rotate TLS certificate chains without breaking Java integrations: SunJSSE trustStore order, compatibility matrix, and fresh canary checks.
This article is for informational and educational purposes only. It is not a security audit, a penetration test or a promise that your systems are free of vulnerabilities or defects. Versions, fixes and dates are current as of the date shown above. Check your vendor's and your distribution's advisories before you act. Any change you apply is your responsibility. No exploit code is provided. Only test systems you own or are authorised to test.
A browser or HTTP 200 monitor passing after a certificate change does not prove a Java client can connect: they may hit different TLS termination points or consult different trust stores. Map each integration flow from TLS termination to the running JVM's effective trust source, remember that SunJSSE falls back to cacerts in current JDK implementations when an explicit trustStore file is unreadable, separate endpoint updates from client upgrades, and gate rollout on a fresh unpooled connection plus a harmless business operation.

Your browser opens the site, the monitor returns 200, and the Java service that synchronizes orders stops connecting. The new certificate can be valid and the outage can still be real. The browser, monitor, and Java process do not necessarily reach the same TLS termination point or build the same path to a trusted root. The operational mistake is signing off on the change because one of them still works.
On November 19, 2026, Oracle published guidance for Oracle Integration that separates two jobs: replace affected endpoint chains and update the JDK actually used by connectivity agents. For agents on the affected Oracle JDK 17 releases it lists (17.0.21, 17.0.21.0.2, and 17.0.21.0.3), Oracle recommends 17.0.21.1+4 or a later applicable supported JDK 17 security update. That version is product-specific advice, not a general Java baseline—Oracle's November 17, 2026 Critical Security Patch Update also lists 27.0.1.1, 25.0.5.1, 21.0.13.1, 11.0.33.1, and 8u513, and other distributions ship their own updates. The transferable lesson is that certificate replacement and client migration are distinct changes, with different owners, tests, and reasons to roll back. That update can remove trust anchors from the default cacerts store. Consult the vendor advisory for the current list of affected chains or roots, and do not improvise imports. A private trust store or an agent keystore.p12 is not trimmed by a JDK upgrade alone: review and remove any anchors the advisory no longer approves. Delaying the client update leaves in place roots the advisory already treats as unacceptable.
Start with the integration, not a server inventory
Identify the operation that needs to survive: fetching an order, downloading a file, or synchronizing a batch. For each critical flow, record who owns the endpoint, which hostname the application uses, and where TLS terminates. The peer certificate may come from a load balancer, gateway, or authorized proxy rather than the server answering the HTTP request. Include regions or replicas with divergent configurations and the route you would actually use in a failover.
On the client side, record the JDK distribution and version, image or binary revision, workload identity, and effective trust-store reference. Get those facts from the workload or its launch and deployment configuration. A java -version result from a separate shell is not enough: the service may use another JAVA_HOME, a bundled JDK, or process-specific options. Avoid dumping environment variables, JVM arguments, or properties to tickets and logs. They often put useful diagnostic facts next to passwords.
A useful inventory row reads flow → hostname and TLS termination → workload and revision → trust source → test → owner. Record public fingerprints of the leaf and intermediate certificates where practical. Then verify that the client can build a path to an approved trust anchor. That path is not necessarily identical to the list the endpoint sends: the client usually already holds the trust anchor, and importing certificates into a client store is no substitute for serving the correct intermediates (by default, JSSE does not fetch AIA caIssuers URLs unless com.sun.security.enableAIAcaIssuers is enabled). Do not enable AIA to fill in intermediates the server should send. If it is enabled, the JVM may fetch URLs embedded in the certificate (availability, network leakage and, in recent releases, controls such as com.sun.security.allowedAIALocations). openssl s_client shows the chain that path presented, not an already verified authority. Compare the public fingerprint over an independent channel (vendor advisory, registry, or internal procedure) before you trust or import anything. Do not treat a certificate just downloaded from the same endpoint as a trust anchor.
Work out which store SunJSSE consults
Oracle's JSSE Reference Guide states that an explicit javax.net.ssl.trustStore takes precedence and, if the file is missing, the default trust manager uses an empty store. In current OpenJDK source (shared with Oracle JDK: TrustStoreManager.java in jdk17u, jdk21u, and jdk-27-ga), however, if the explicit path is not a readable file, initialization falls back to the JDK's cacerts, whereas when the property is unset it checks jssecacerts and then cacerts. Setting javax.net.ssl.trustStore=NONE does not fall back to cacerts: the runtime loads a non-file store, which stays empty if no provider supplies one. If the explicit file exists and is readable, a wrong password or store type does not trigger that fallback. When fallback to cacerts does occur, the runtime reuses the configured trustStorePassword and trustStoreType, so a typo in the path will not always accept the public CAs in cacerts. That means a missing mount or typo will reject a private lab CA—only because it is absent from cacerts—yet can silently connect to a public endpoint trusted by cacerts instead of failing closed, but only when the reused password and type also open cacerts. Separate stores maintained outside cacerts (such as a custom trustStore or an agent keystore.p12) are also unaffected by a JDK update alone, and a framework or SDK creating its own SSLContext can override all of these. Check the client making the connection instead of assuming it matches a Java example. That caveat is not a fail-closed guarantee on JDK 18 or later: the JDK cacerts file became a password-less PKCS #12 store and can be loaded with any password, so an unreadable explicit path may still accept the public roots in cacerts even when trustStorePassword is not changeit. On JDK 17 and earlier, cacerts is typically still JKS with the initial changeit password, and a different reused password may prevent that opening.
The default TLS context initializes its trust managers once at startup. Do not assume a running process reloads a changed store: validate with a freshly started process or the client's documented reload mechanism.
That distinction explains a common failure when a container is recreated: the image has up-to-date certificates, but the application still points to a mount that no longer exists or holds stale material. Fix the configuration and deploy the approved trust material for that client. Do not turn off hostname verification or install a trust manager that accepts any certificate. If you use mutual TLS (mTLS), also separate the store holding the client's identity and private key from the store the client uses to verify the server. Do not rotate both just because they both contain certificates. Prefer an application trustStore; a change to the JDK's cacerts is inherited by every process on that installation, and a later update can overwrite it or remove anchors again.
Diagnostic checks and compatibility matrix
# Read-only checks against the running JVM PID and endpoint (not run on this box). Do not grep for trustStore alone: that also matches trustStorePassword. Then list the effective store reported by jcmd; do not assume cacerts. On JDK 8, to list the default cacerts use -keystore "$JAVA_HOME/jre/lib/security/cacerts" (-cacerts requires JDK 9+). Do not pass -storepass on the command line; let keytool prompt if needed. On JDK 18 or later, cacerts is typically a password-less PKCS #12 store; changeit is the documented initial cacerts password on JDK 17 and earlier, not necessarily the one in use.
jcmd <pid> VM.system_properties | grep -E 'javax\.net\.ssl\.trustStore=|javax\.net\.ssl\.trustStoreType=|javax\.net\.ssl\.trustStoreProvider=|java\.home='
keytool -list -keystore <truststore> | head -n 20
openssl s_client -connect orders.example.test:443 -servername orders.example.test -showcerts </dev/nullImagine a lab with orders.example.test, two fictional chains, and one Java worker. Chain A remains valid because this is a planned rotation, not a CA compromise. B is the target chain. These are expected outcomes, not measured results:
- Chain A and current client — Expected: Connects. What it tells you: The baseline is healthy.
- Chain B and current client — Expected: Rejects if B is not trusted. What it tells you: Do not change the endpoint first for everyone.
- Chain A and transition client — Expected: Connects. What it tells you: You can prepare the transition if both chains remain authorized.
- Chain B and transition or final client — Expected: Connects. What it tells you: You have a viable target pairing.
- Chain B and client pointing at a missing explicit store — Expected: Falls back to cacerts in current JDKs (rejects a private lab CA not in cacerts, may accept a public CA present in cacerts). What it tells you: Verify the explicit store path exists and is readable; do not assume a missing path fails closed.
In an author-reported local test with OpenJDK 27 (GA September 15, 2026), an HTTP client connected to loopback HTTPS endpoints signed by two independent lab CAs not present in cacerts: A-to-A, transition-to-either, and B-to-B returned HTTP 200 and the expected readiness response, while A-to-B, B-to-A, and the missing-store client against lab-CA B rejected the TLS handshake (via fallback to cacerts lacking lab CA B). This was not independently re-executed in this environment without JDK 27, and was neither an Oracle Integration test nor a business transaction. Dual trust in the lab models only a planned rotation between two healthy authorities.
For a routine rotation, if the current client already trusts B, changing the endpoint first may be fine. Otherwise, a temporary client configuration can trust both chains only while both remain approved, with a named owner and retirement date. Start with one consumer and one test termination point. Prove that pairing, expand in cohorts, and remove transitional trust. The best order is not the one with the fewest file changes. It is the one that preserves at least one safe, working pairing at each stage. If the client uses pinning, rotate the pins explicitly; do not disable pinning just to complete the migration.
If A is affected by a compromise, the routine-rotation matrix no longer applies. Do not keep or restore the affected trust to recover availability. Plan a coordinated containment window: distribute only approved trust, switch the endpoint in a coordinated sequence, or move to a verified fallback termination point serving an unaffected chain. If no safe fallback exists, make the expected interruption and recovery ownership explicit. As Oracle notes, renewing a leaf under the same affected chain will not solve the problem.
Require two tests and a safe recovery route
First, require a new connection from the real client on its own network path and using the actual hostname. A pooled connection established before the change can stay alive and hide a failing new handshake. Check hostname, presented chain, and expiration at the intended termination point. Match the running workload revision and trust source to the inventory. Run any negative control only in the lab with disposable configuration (such as an untrusted lab CA store) so that expected rejection confirms your test notices a real trust mismatch rather than accepting arbitrary certificates.
Then run one harmless business operation: read a test order or have a worker process a synthetic message without touching customer data or payments. Check the outcome, not just a 200 response. A successful handshake does not prove application authentication, permissions, data correctness, or rollout across all replicas. Watch certificate validation failures and queue backlog during the canary. Set thresholds against your own baseline and use an observation window that includes at least one scheduled execution of the workflow. Make acceptance explicit: PKI signs off on the chain, platform confirms the deployed revision and fallback route, and the integration owner verifies the functional result.
If the canary fails, stop expanding. Roll back application code or shift traffic to another termination point only if that route keeps an approved chain and trust store. In a trust incident, reverting to an older image is not a recovery plan by itself: it can restore the same trust you are trying to remove. For the service owner, the release rule is simple: proceed only once a new connection, a successful business operation, and a safe recovery route are demonstrated for the critical flow. If one is missing, you have a pending test, not a finished migration.
Frequently asked questions
- Why does Java fail with a TLS error when the browser and monitor return HTTP 200? Because the browser, monitor, and Java process can hit different TLS termination points (load balancer, proxy, gateway) or validate against a different trust store.
- How does SunJSSE resolve trust stores if javax.net.ssl.trustStore is set to a missing file? Although the JSSE Reference Guide states it uses an empty store, current OpenJDK source (shared with Oracle JDK: TrustStoreManager) falls back to cacerts if the explicit path is not readable, reusing trustStorePassword and trustStoreType. Setting the property to NONE does not fall back to cacerts, and a readable file with the wrong password or type does not trigger fallback. A missing path therefore only rejects CAs absent from cacerts, and may still connect to public endpoints, when the reused password and type also open cacerts. That caveat is not a fail-closed guarantee on JDK 18 or later: the JDK cacerts file became a password-less PKCS #12 store and can be loaded with any password, so an unreadable explicit path may still accept the public roots in cacerts even when trustStorePassword is not changeit.
- Is Oracle's 17.0.21.1+4 recommendation a universal baseline for every Java app? No. It is Oracle Integration's November 19, 2026 guidance for connectivity agents on affected Oracle JDK 17 builds; the November 17, 2026 CSPU also shipped 27.0.1.1, 25.0.5.1, 21.0.13.1, 11.0.33.1, and 8u513, and other JDK vendors publish their own updates.
- When is a dual-trust bridge client allowed and when is it prohibited? It is acceptable only during planned rotations where both old and new chains remain authorized, with an owner and retirement date. In a trust compromise incident, do not retain or re-import affected trust material.
Related reading
Sources
- Oracle Integration Blog: Replace Affected Endpoint Certificates and Update Connectivity Agent JDK (November 19, 2026)
- Oracle Java SE 21 JSSE Reference Guide
- OpenJDK jdk-27-ga: TrustStoreManager.java (fallback behavior to cacerts)
- Oracle Java SE Critical Security Patch Update Release Notes (November 17, 2026)
Let an agent prepare this. Your team approves it.
An agent can track advisories, check them against your versions and prepare the update for your team to review and apply. We design that workflow: scoped permissions, human approval before any change, and a log of every step. We do not audit or patch your systems.


