{"record":{"id":"128c38ed7525def2","repo":"golang/go","slug":"tls-server-sent-an-unexpected-quic-transport-para","errorCode":null,"errorMessage":"tls: server sent an unexpected quic_transport_parameters extension","messagePattern":"tls: server sent an unexpected quic_transport_parameters extension","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/crypto/tls/handshake_client_tls13.go","lineNumber":557,"sourceCode":"\t\t// does not specify how clients handle the selection of an incompatible protocol.\n\t\t// RFC 9001 Section 8.1 specifies that QUIC clients send no_application_protocol\n\t\t// in this case. Always sending no_application_protocol seems reasonable.\n\t\tc.sendAlert(alertNoApplicationProtocol)\n\t\treturn err\n\t}\n\tc.clientProtocol = encryptedExtensions.alpnProtocol\n\n\tif c.quic != nil {\n\t\tif encryptedExtensions.quicTransportParameters == nil {\n\t\t\t// RFC 9001 Section 8.2.\n\t\t\tc.sendAlert(alertMissingExtension)\n\t\t\treturn errors.New(\"tls: server did not send a quic_transport_parameters extension\")\n\t\t}\n\t\tc.quicSetTransportParameters(encryptedExtensions.quicTransportParameters)\n\t} else {\n\t\tif encryptedExtensions.quicTransportParameters != nil {\n\t\t\tc.sendAlert(alertUnsupportedExtension)\n\t\t\treturn errors.New(\"tls: server sent an unexpected quic_transport_parameters extension\")\n\t\t}\n\t}\n\n\tif !hs.hello.earlyData && encryptedExtensions.earlyData {\n\t\tc.sendAlert(alertUnsupportedExtension)\n\t\treturn errors.New(\"tls: server sent an unexpected early_data extension\")\n\t}\n\tif hs.hello.earlyData && !encryptedExtensions.earlyData {\n\t\tc.quicRejectedEarlyData()\n\t}\n\tif encryptedExtensions.earlyData {\n\t\tif hs.session.cipherSuite != c.cipherSuite {\n\t\t\tc.sendAlert(alertHandshakeFailure)\n\t\t\treturn errors.New(\"tls: server accepted 0-RTT with the wrong cipher suite\")\n\t\t}\n\t\tif hs.session.alpnProtocol != c.clientProtocol {\n\t\t\tc.sendAlert(alertHandshakeFailure)\n\t\t\treturn errors.New(\"tls: server accepted 0-RTT with the wrong ALPN\")","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/crypto/tls/handshake_client_tls13.go#L539-L575","documentation":"Mirror of 630: when the connection is NOT in QUIC mode (c.quic == nil), EncryptedExtensions must NOT carry quic_transport_parameters. Go sends `unsupported_extension` if it does. Indicates a regular TLS 1.3 server incorrectly emitting a QUIC-only extension.","triggerScenarios":"Standard tls.Dial/tls.Client handshake where the server's EncryptedExtensions includes quic_transport_parameters. c.quic is nil because the caller did not enable QUIC mode.","commonSituations":"Server that always sends quic_transport_parameters regardless of transport, a misconfigured proxy, or a TLS library bug on the server. Should not occur against compliant servers.","solutions":["Report to the server operator — the extension is QUIC-only.","Capture the EncryptedExtensions to confirm the unexpected extension is server-origin.","Test the same hostname over a known client (openssl s_client) to cross-check.","Patch the server to only emit the extension on QUIC transports."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-flight: ensure you are not accidentally enabling QUIC mode for a TCP connection.\n// QUIC mode is set by the QUIC library via non-exported hooks; using tls.Dial keeps c.quic == nil.\n// If you see this error, the server is at fault — no client-side prevention.","typeGuard":null,"tryCatchPattern":"if err := conn.Handshake(); err != nil {\n    if strings.Contains(err.Error(), \"unexpected quic_transport_parameters\") {\n        log.Printf(\"server %s emitted a QUIC-only extension over TCP\", addr)\n    }\n    return err\n}","preventionTips":["Report servers that emit QUIC-only extensions over TCP.","Packet-capture to confirm the extension origin.","Cross-check with openssl s_client."],"tags":["tls","tls13","quic","encrypted-extensions","protocol-violation","network","go"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}