Originally published on Medium: https://medium.com/@seshikanthguduri/when-enforcing-tls-1-3-broke-our-ci-builds-d0b026e699eb
The registry got more secure. The builds got red. Both were telling the truth.
TLS 1.3 negotiation: the CI runner asks, the registry answers, and only a shared protocol version opens the tunnel.
Security work has a cruel property: the correct change can still take the pipeline down. We enforced TLS 1.3 on the remote artifact registry that our CI system publishes to. The change was right. It was also the start of a wave of failed Java builds, broken Maven and Gradle publishes, and curl uploads that suddenly could not complete a handshake. Nothing about the failure looked like a TLS version problem at first, which is why it is worth writing down in full.
The change that looked safe
The registry endpoint was tightened to require TLS 1.3. Older protocol versions were dropped on purpose: TLS 1.3 removes legacy cipher suites, shortens the handshake, and encrypts more of the negotiation. From the server side, the change is a config line and a restart. From the client side, it is a contract change, and every client that cannot speak TLS 1.3 is now locked out, no matter how valid its credentials are.
That distinction matters. Authentication failures say "who are you." Protocol failures say "I cannot even talk to you." Our jobs were failing in the second way, but the error messages were generic enough to send the first hours of debugging toward credentials, network rules, and the registry itself.
What actually broke, and why
A TLS handshake negotiates the highest protocol version both sides support. When the server offers only TLS 1.3, a client whose maximum is TLS 1.2 has nothing to negotiate. The server terminates the handshake, and the client reports whatever its TLS library feels like reporting, which is rarely "the other side requires TLS 1.3."
The TLS 1.3 handshake, forward and backward: one round trip, and everything after ServerHello is encrypted.
Java builds were the biggest casualty. Maven and Gradle run on the JVM, and the JVM decides which TLS versions a client offers. That behavior depends on the JDK version and update level. TLS 1.3 support arrived in JDK 11, and was backported to later JDK 8 updates, but plenty of build images still run JDKs whose default client protocols top out at TLS 1.2, or where TLS 1.3 is present but not enabled by default. The job does not know any of this. It just fails to publish the artifact at the end of an otherwise green build, which is the most expensive place to fail: all the compute already happened, and the one step that mattered, delivering the package, is the step that dies.
The curl failures looked unrelated and were not. Some upload scripts used curl builds linked against older TLS libraries, or pinned protocol flags copied from older examples. A script that explicitly caps the TLS version, or a curl old enough that its library does not know TLS 1.3, fails against a TLS 1.3 only endpoint in exactly the same way, with errors like "SSL connect error" that again point nowhere useful.
So one server side change produced three symptom families: Java publish failures, Gradle publish failures, and script upload failures. Same root cause, three different error dialects.
The fix, in two parts
Part one was the JVM. Java lets you set the client protocol list with the system property jdk.tls.client.protocols. Setting it to "TLSv1.2,TLSv1.3" tells the JVM to offer both, and the handshake settles on 1.3 where the server requires it. The important decision was where to set it. Fixing one project's pipeline file would have fixed one project. Setting it through JAVA_TOOL_OPTIONS and MAVEN_OPTS at the CI level, in the shared runner configuration, meant every Java job inherited the fix without each team editing their build. Platform work should land at the platform layer; this was that principle with a flag attached.
Part two was the upload scripts. The curl based uploads to the container registry were wrapped in a script that explicitly allows the latest TLS version, so uploads negotiate TLS 1.3 instead of failing against the tightened endpoint. Same pattern as the JVM fix: one shared script, fixed once, instead of a dozen copies drifting in individual repositories.
Neither fix weakens the security change. The registry still requires TLS 1.3. The clients were taught to speak it.
Before and after: the same ClientHello, two different outcomes.
The questions everyone asks
Why not just re-enable TLS 1.2 on the server? That is the fastest unblock and the worst fix. It silently reverses the security decision, and it teaches the organization that enforcement is negotiable whenever builds complain. A short, announced transition window with dual support is defensible. A quiet permanent rollback is not.
Why did some jobs pass while others failed? Because "the CI system" is not one client. Different jobs run different images, different JDKs, and different upload tools. Any job already on a TLS 1.3 capable stack passed untouched. That partial failure pattern is a fingerprint of a client side protocol problem: server outages fail everything, client mismatches fail a subset.
Is this a certificate problem? No, and that is the trap. Certificate errors happen after the protocol is agreed. These handshakes died before certificates were even exchanged. When the error appears before authentication, suspect the protocol negotiation first.
Could we have just upgraded every JDK instead? Eventually, yes, and that is the durable fix. But a fleet wide JDK upgrade is a program of work with its own breakage risk, measured in weeks. The protocol property is a bridge: it unblocks everyone today on the JDKs they already run, and the upgrade can then happen on a sane schedule instead of during an incident.
Why enforce TLS 1.3 at all? Because registries hold the artifacts that become production. The path between CI and the registry is part of the supply chain, and "the build was green" means little if the artifact traveled over a protocol with known weak options still enabled. Enforcement is what turns "we support TLS 1.3" from a brochure claim into a fact.
How do you roll this out without breaking everyone next time? Stage it. Announce the date, scan which clients connect with which protocol versions while both are still accepted, contact the owners of the laggards, and only then enforce. We learned the ordering the hard way: enforce first, discover clients second is backwards. The telemetry exists in server logs the whole time; the discipline is reading it before the change, not after.
What this problem really is
It is tempting to file this under "TLS settings," but the real problem is contract management between a platform and its consumers. Every endpoint a platform serves is a contract, and protocol versions are clauses. Changing a clause without inventorying the signatories breaks people who never agreed to the new terms, and they experience it as an outage you caused, because from their chair, you did.
The fix took an afternoon. The lesson is permanent: before tightening anything, a protocol, a schema, an API version, list who connects, what they speak, and how you will know when they are ready. Security enforcement and developer experience are not opponents here. Sequencing is what separates them.
TLS 1.3 was never the problem. Surprising your own clients was.
