{"record":{"id":"8a8d2f9f1f2240eb","repo":"golang/go","slug":"tls-server-selected-unsupported-compression-forma","errorCode":null,"errorMessage":"tls: server selected unsupported compression format","messagePattern":"tls: server selected unsupported compression format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/crypto/tls/handshake_client.go","lineNumber":890,"sourceCode":"}\n\nfunc (hs *clientHandshakeState) serverResumedSession() bool {\n\t// If the server responded with the same sessionId then it means the\n\t// sessionTicket is being used to resume a TLS session.\n\treturn hs.session != nil && hs.hello.sessionId != nil &&\n\t\tbytes.Equal(hs.serverHello.sessionId, hs.hello.sessionId)\n}\n\nfunc (hs *clientHandshakeState) processServerHello() (bool, error) {\n\tc := hs.c\n\n\tif err := hs.pickCipherSuite(); err != nil {\n\t\treturn false, err\n\t}\n\n\tif hs.serverHello.compressionMethod != compressionNone {\n\t\tc.sendAlert(alertIllegalParameter)\n\t\treturn false, errors.New(\"tls: server selected unsupported compression format\")\n\t}\n\n\tsupportsPointFormat := false\n\tofferedNonCompressedFormat := false\n\tfor _, format := range hs.serverHello.supportedPoints {\n\t\tif format == pointFormatUncompressed {\n\t\t\tsupportsPointFormat = true\n\t\t} else {\n\t\t\tofferedNonCompressedFormat = true\n\t\t}\n\t}\n\tif !supportsPointFormat && offeredNonCompressedFormat {\n\t\treturn false, errors.New(\"tls: server offered only incompatible point formats\")\n\t}\n\n\tif c.handshakes == 0 && hs.serverHello.secureRenegotiationSupported {\n\t\tc.secureRenegotiation = true\n\t\tif len(hs.serverHello.secureRenegotiation) != 0 {","sourceCodeStart":872,"sourceCodeEnd":908,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/crypto/tls/handshake_client.go#L872-L908","documentation":"TLS 1.2 and earlier carry a compression_method field in the ServerHello. Modern TLS permits only compressionNone (0); any other selection enables CRIME/BREACH-style compression oracle attacks and Go implements no compression, so the handshake is aborted with alertIllegalParameter.","triggerScenarios":"Server selects DEFLATE (compression method 1) or another non-null method; corrupted ServerHello decoding; malicious server probing for vulnerable clients.","commonSituations":"Very old or non-conformant TLS stacks; tampered traffic; essentially never seen from modern servers.","solutions":["Treat this as a server-side defect; the server must select null compression.","Capture the ServerHello to confirm the field value and report to the server operator.","Investigate the network path for a tampering device."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"func isUnsupportedCompression(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"server selected unsupported compression format\")\n}","tryCatchPattern":"if _, err := tls.Dial(\"tcp\", addr, cfg); err != nil {\n    if isUnsupportedCompression(err) {\n        // Server is non-conformant or path is being tampered with; do not retry.\n        reportServerDefect(addr, err)\n    }\n}","preventionTips":["Report server defects that select non-null compression.","Investigate the path for tampering."],"tags":["tls","compression","security","protocol"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}