{"record":{"id":"51e8a53fa22d941b","repo":"golang/go","slug":"tls-client-offered-tls-version-older-than-tls-1-3","errorCode":null,"errorMessage":"tls: client offered TLS version older than TLS 1.3","messagePattern":"tls: client offered TLS version older than TLS 1\\.3","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/crypto/tls/handshake_server_tls13.go","lineNumber":272,"sourceCode":"\ths.sharedKey, hs.hello.serverShare, err = ke.serverSharedSecret(c.config.rand(), clientKeyShare.data)\n\tif err != nil {\n\t\tc.sendAlert(alertIllegalParameter)\n\t\treturn errors.New(\"tls: invalid client key share\")\n\t}\n\n\tselectedProto, err := negotiateALPN(c.config.NextProtos, hs.clientHello.alpnProtocols, c.quic != nil)\n\tif err != nil {\n\t\tc.sendAlert(alertNoApplicationProtocol)\n\t\treturn err\n\t}\n\tc.clientProtocol = selectedProto\n\n\tif c.quic != nil {\n\t\t// RFC 9001 Section 4.2: Clients MUST NOT offer TLS versions older than 1.3.\n\t\tfor _, v := range hs.clientHello.supportedVersions {\n\t\t\tif v < VersionTLS13 {\n\t\t\t\tc.sendAlert(alertProtocolVersion)\n\t\t\t\treturn errors.New(\"tls: client offered TLS version older than TLS 1.3\")\n\t\t\t}\n\t\t}\n\t\t// RFC 9001 Section 8.2.\n\t\tif hs.clientHello.quicTransportParameters == nil {\n\t\t\tc.sendAlert(alertMissingExtension)\n\t\t\treturn errors.New(\"tls: client did not send a quic_transport_parameters extension\")\n\t\t}\n\t\tc.quicSetTransportParameters(hs.clientHello.quicTransportParameters)\n\t} else {\n\t\tif hs.clientHello.quicTransportParameters != nil {\n\t\t\tc.sendAlert(alertUnsupportedExtension)\n\t\t\treturn errors.New(\"tls: client sent an unexpected quic_transport_parameters extension\")\n\t\t}\n\t}\n\n\tc.serverName = hs.clientHello.serverName\n\treturn nil\n}","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/crypto/tls/handshake_server_tls13.go#L254-L290","documentation":"RFC 9001 §4.2 mandates QUIC use TLS 1.3 minimum; older TLS versions are forbidden in QUIC. If any entry in the QUIC ClientHello's supportedVersions is below VersionTLS13 (0x0304), the server sends protocol_version and aborts.","triggerScenarios":"A QUIC handshake where the client includes TLS 1.2 (0x0303) or earlier in supportedVersions.","commonSituations":"A QUIC stack that incorrectly advertises TLS 1.2 compatibility; a TLS 1.2 client mistakenly run over a QUIC transport; QUIC/TLS interop bugs.","solutions":["Configure the QUIC client to advertise only TLS 1.3 (0x0304) in supported_versions","Use a QUIC stack that conforms to RFC 9001 (do not mix TLS 1.2 code paths with QUIC)"],"exampleFix":"// before\nsupportedVersions = []uint16{0x0303, 0x0304}\n\n// after\nsupportedVersions = []uint16{0x0304}","handlingStrategy":"validation","validationCode":"// QUIC client: ensure no TLS version below 1.3 is advertised.\nfor _, v := range supportedVersions {\n    if v < 0x0304 {\n        return fmt.Errorf(\"QUIC forbids TLS version 0x%04x\", v)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := tlsConn.Handshake(); err != nil {\n    if strings.Contains(err.Error(), \"older than TLS 1.3\") {\n        log.Printf(\"QUIC client advertised pre-1.3 from %v\", remote)\n    }\n    c.Close()\n    return\n}","preventionTips":["In QUIC, advertise only TLS 1.3 in supported_versions","Use a QUIC stack that conforms to RFC 9001; never reuse a TLS 1.2 code path over QUIC"],"tags":["tls","go","quic","version","rfc9001","protocol-version","handshake"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}