Add configurable min/max TLS version with hybrid per-transport default - #7
Draft
DanPeterson wants to merge 2 commits into
Draft
Add configurable min/max TLS version with hybrid per-transport default#7DanPeterson wants to merge 2 commits into
DanPeterson wants to merge 2 commits into
Conversation
SPP 9.0 enables TLS 1.3. Go's crypto/tls client cannot answer a TLS 1.3 post-handshake CertificateRequest, so certificate login and A2A (which rely on SPP's post-handshake certificate request) break against a TLS 1.3-only appliance on the Standard binding. Add WithMinTLSVersion / WithMaxTLSVersion functional options as a uint16 passthrough to crypto/tls (future-proof; no enum to age). Default is hybrid per-transport: TLS 1.2 floor everywhere, serverTrust open to 1.3, but the clientCert transport (certificate login, A2A) capped at 1.2 so post-handshake cert-auth keeps working out of the box. Setting either option lifts the cap, enabling TLS 1.3 cert-auth against the appliance Cert SNI hostname. Update api-patterns/architecture/a2a-workflow skills, AGENTS.md, and the certificate sample (-min-tls/-max-tls flags).
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.
Summary
SPP 9.0 enables TLS 1.3. Go's
crypto/tlsclient cannot answer a TLS 1.3 post-handshakeCertificateRequest(verified in the stdlib:handlePostHandshakeMessageonly handlesnewSessionTicketMsgTLS13/keyUpdateMsg; acertificateRequestMsgTLS13errors withunexpected_message, and Go never advertisespost_handshake_auth). Because SPP certificate login and A2A rely on SPP's post-handshake certificate request, they break against a TLS 1.3-only appliance on the Standard binding. Password / PKCE / browser / device-code / token flows are unaffected.This PR makes the TLS version window configurable and picks a safe hybrid default so cert-auth keeps working out of the box on 9.0.
What changed
New options (
tls.go):WithMinTLSVersion(v uint16)/WithMaxTLSVersion(v uint16)— auint16passthrough tocrypto/tlsversion constants. No custom enum, so a future TLS 1.4 works with zero SDK change. Sub-1.2 is allowed as an explicit escape hatch (guarded#nosec G402).Hybrid per-transport default (
transport.go,tls.go):serverTrusttransport (password/token/PKCE) stays open to 1.3.clientCerttransport (certificate login, A2A) is capped at 1.2 when no explicit version option is set — so post-handshake cert-auth "just works" on the 9.0 Standard binding.clientCerttransport already presents the cert up front.Docs & sample:
.agents/skills/api-patterns,architecture,a2a-workflowskills +AGENTS.mddocument the version window, hybrid default, the Cert SNI route, and the60094 Authorization is deniedsymptom.samples/certificategains-min-tls/-max-tlsflags.Tests
tls_test.go:TestBuildTLSConfigVersionWindow,TestClientCertMaxTLSResolver,TestClientCertTransportCapsMaxTLS(default caps clientCert to 1.2 while serverTrust stays open; explicit options lift the cap;max < minis rejected).go build,go vet,gofmt -l,golangci-lint run, andgo test ./...are all green.Relation to SafeguardJava #190
Same root limitation (JSSE also can't do TLS 1.3 client PHA). Differences: Java defaults to TLS 1.2-only for all traffic via a process-wide static enum; this PR keeps 1.3 for non-cert flows via a per-client, per-transport default and a future-proof
uint16window, matching the PySafeguard min/max approach.