Repository navigation
Conversation
CydeWeys
force-pushed
the
epp-tls-quota-fsm
branch
from
November 27, 2026 19:03
b33b5a9 to
49bca97
Compare
CydeWeys
force-pushed
the
epp-tls-quota-fsm
branch
from
November 27, 2026 20:35
49bca97 to
80b0374
Compare
CydeWeys
force-pushed
the
epp-tls-quota-fsm
branch
2 times, most recently
from
December 4, 2026 21:35
8599806 to
3acc6fc
Compare
Implicit connection flags, split certificate caches, and misclassified
HTTP status codes across EPP transport, proxy quota enforcement, and
scheduled background tasks create security bypasses, rotation outages,
and silent operational failures. Replacing those ad-hoc booleans and
split caches with explicit state machines and atomic credentials keeps
connection lifecycles unambiguous, ensures TLS rotations never pair
mismatched keys and certificates, enforces RFC 5734 session closure and
PROXY v1 framing caps, and prevents Cloud Tasks from silently dropping
domain purges or RDE escrow uploads and staging failures.
Changes:
- Atomic TLS credentials and SslContext caching (CertificateSupplierModule,
SslServerInitializer, core/proxy EppProtocolModule): bundle private key
and ordered certificate chain in one TlsCredentials record cached under a
single memoizeWithExpiration TTL, fail fast on unsupported Mode.P12_FILE,
cache/rebuild SslContext atomically only on credential rotation instead
of per TCP connection, and re-read credentials inside the build lock so
stale reads cannot overwrite rotated contexts.
- Disable server-side TLS session resumption on cached mTLS SslContexts
(SslServerInitializer, jetty/kubernetes/*, proxy/kubernetes/*,
jetty/start.sh, proxy/Dockerfile, networking/build.gradle): BoringSSL
omits intermediate certificates on resumed server sessions, which would
break post-handshake client certificate chain validation on 3+ tier
chains, and both JDK and Netty OpenSSL emit stateless TLS 1.2/1.3
session tickets unless jdk.tls.server.enableSessionTicketExtension=false
is set. Because EPP uses persistent TCP connections and previously built
a fresh SslContext per connection, TLS session resumption was never used
in production. Explicitly disable the OpenSSL session cache
(setSessionCacheEnabled(false) / SSL_SESS_CACHE_OFF), unconditionally
invalidate server-side sessions on handshake completion
(sslSession.invalidate()), log a startup warning if the ticket flag is
absent on an mTLS server, and set
-Djdk.tls.server.enableSessionTicketExtension=false across all Jetty and
proxy Kubernetes containers, Dockerfiles/start.sh, and networking tests
so every mTLS connection performs a full handshake and preserves full
client certificate chains on both TLS 1.2 and TLS 1.3.
- Explicit integrated EPP connection FSM (core EppServiceHandler): replace
ad-hoc boolean flags with a flat ConnectionState enum (AWAITING_TLS,
READY_UNAUTHENTICATED, AUTHENTICATED, CLOSING) and a single idempotent
releaseConnectionLimits() helper, execute already-completed cert promises
inline in channelActive (and re-check after addListener() to close the
cross-executor TOCTOU window), reject pre-TLS frames and non-200 servlet
responses fail-closed, guard buildServletRequest() inside try/catch so
OIDC token errors fail closed and release limits, defer CLOSING until
close-on-flush succeeds so write failures still release limits and close,
remove the sticky <clID> regex latch on failed logins, preserve client
certificate chain validation and hostname header forwarding, and drop
pipelined frames in CLOSING.
- Proxy quota lease FSM and PROXY v1 header cap (QuotaHandler,
ProxyProtocolHandler): add LeaseState (UNCHECKED, LEASED, REJECTED,
RELEASED) so pipelined frames after quota rejection are dropped and
released instead of bypassing checks, and enforce the 107-byte HAProxy
PROXY protocol v1 header cap to prevent unbounded buffer growth.
- RFC 5734 section 2 close on 2501 (EppRequestHandler): set Epp-Session:
close on AUTHENTICATION_ERROR_CLOSING_CONNECTION (2501) as well as
SUCCESS_AND_CLOSE (1500).
- Rolled-in P0 operational hotfixes (b/591075298, b/591075515):
- ResaveEntityAction: pass tm().getTxTime() (filtering remaining times)
instead of original requestedTime so Day-35 final purges (30d RGP +
5d pending delete > 30d MAX_ASYNC_ETA) are not silently dropped, and
enqueue the follow-up Cloud Task outside the SERIALIZABLE transaction.
- RdeUploadAction: throw ServiceUnavailableException (503) instead of
NoContentException (204) on SFTP cooldown so Cloud Tasks retries.
- RdeStagingAction: preserve HTTP 500 when any Dataflow launch throws
IOException instead of overwriting the status with 200.
Operational justification and blast radius:
Eliminates TLS rotation key/cert mismatch outages, per-connection native
OpenSSL context churn, resumed-session client chain truncation, pre-TLS
and post-rejection quota bypasses, unbounded PROXY header memory
allocation, and silent RDE/domain-purge drops across the frontend
EPP/proxy tier and backend Cloud Tasks actions, keeping JDK_JAVA_OPTIONS
in parity across all 15 Jetty and proxy containers with zero database
schema, Flyway, or Valkey Protostuff changes.
BUG= http://b/591076386
CydeWeys
force-pushed
the
epp-tls-quota-fsm
branch
from
December 5, 2026 03:18
3acc6fc to
9b53286
Compare
This branch has not been deployed
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.
Implicit connection flags, split certificate caches, and misclassified HTTP status codes across EPP transport, proxy quota enforcement, and scheduled background tasks create security bypasses, rotation outages, and silent operational failures. Replacing those ad-hoc booleans and split caches with explicit state machines and atomic credentials keeps connection lifecycles unambiguous, ensures TLS rotations never pair mismatched keys and certificates, enforces RFC 5734 session closure and PROXY v1 framing caps, and prevents Cloud Tasks from silently dropping domain purges or RDE escrow uploads and staging failures.
Changes
SslContextcaching (CertificateSupplierModule,SslServerInitializer,core/proxyEppProtocolModule): bundle private key and ordered certificate chain in oneTlsCredentialsrecord cached under a singlememoizeWithExpirationTTL, fail fast on unsupportedMode.P12_FILE, cache/rebuildSslContextatomically only on credential rotation instead of per TCP connection, and re-read credentials inside the build lock so stale reads cannot overwrite rotated contexts.SslContexts (SslServerInitializer,jetty/kubernetes/*,proxy/kubernetes/*,jetty/start.sh,proxy/Dockerfile,networking/build.gradle): BoringSSL omits intermediate certificates on resumed server sessions, which would break post-handshake client certificate chain validation on 3+ tier chains, and both JDK and Netty OpenSSL emit stateless TLS 1.2/1.3 session tickets unless-Djdk.tls.server.enableSessionTicketExtension=falseis set. Because EPP uses persistent TCP connections and previously built a freshSslContextper connection, TLS session resumption was never used in production. Explicitly disable the OpenSSL session cache (setSessionCacheEnabled(false)/SSL_SESS_CACHE_OFF), unconditionally invalidate server-side sessions on handshake completion (sslSession.invalidate()), log a startup warning if the ticket flag is absent on an mTLS server, and pass-Djdk.tls.server.enableSessionTicketExtension=falseinJDK_JAVA_OPTIONSacross all 15 Jetty and proxy Kubernetes containers (plusjetty/start.sh,proxy/Dockerfile, andnetworking/build.gradletests) so every mTLS connection performs a full handshake and preserves full client certificate chains on both TLS 1.2 and TLS 1.3.coreEppServiceHandler): replace ad-hoc boolean flags with a flatConnectionStateenum (AWAITING_TLS,READY_UNAUTHENTICATED,AUTHENTICATED,CLOSING) and a single idempotentreleaseConnectionLimits()helper, execute already-completed cert promises inline inchannelActive(and re-check afteraddListener()to close the cross-executor TOCTOU window), reject pre-TLS frames and non-200 servlet responses fail-closed, guardbuildServletRequest()insidetry/catchso OIDC token errors fail closed and release limits, deferCLOSINGuntil close-on-flush succeeds so write failures still release limits and close, remove the sticky<clID>regex latch on failed logins, preserve client certificate chain validation and hostname header forwarding, and drop pipelined frames inCLOSING.QuotaHandler,ProxyProtocolHandler): addLeaseState(UNCHECKED,LEASED,REJECTED,RELEASED) so pipelined frames after quota rejection are dropped and released instead of bypassing checks, and enforce the 107-byte HAProxy PROXY protocol v1 header cap to prevent unbounded buffer growth.2501(EppRequestHandler): setEpp-Session: closeonAUTHENTICATION_ERROR_CLOSING_CONNECTION(2501) as well asSUCCESS_AND_CLOSE(1500).ResaveEntityAction: passtm().getTxTime()(filtering remaining times) instead of originalrequestedTimeso Day-35 final purges (30dRGP +5dpending delete >30dMAX_ASYNC_ETA) are not silently dropped, and enqueue the follow-up Cloud Task outside theSERIALIZABLEtransaction.RdeUploadAction: throwServiceUnavailableException(503) instead ofNoContentException(204) on SFTP cooldown so Cloud Tasks retries.RdeStagingAction: preserve HTTP500when any Dataflow launch throwsIOExceptioninstead of overwriting the status with200.Operational Justification & Blast Radius
Eliminates TLS rotation key/cert mismatch outages, per-connection native OpenSSL context churn, resumed-session client chain truncation, pre-TLS and post-rejection quota bypasses, unbounded PROXY header memory allocation, and silent RDE/domain-purge drops across the frontend EPP/proxy tier and backend Cloud Tasks actions, keeping
JDK_JAVA_OPTIONSin parity across all 15 Jetty and proxy containers with zero database schema, Flyway, or Valkey Protostuff changes.BUG= http://b/591076386
This change is