22

I've had a look within the official TLS specification but I cannot see any mention of this. Does TLS allow compression to be disabled? Or is it mandatory?

1
  • 18
    In 1.3 compression is prohibited (the field is still there, but it must not specify anything other than 0 = identity) Oct 5, 2022 at 1:29

2 Answers 2

40

Compression is not mandatory in TLS. And in modern libraries or products, it is often disabled by default because of possible attack vectors like CRIME which rely on TLS level compression.

Notably also what dave-thompson-085 said in a comment to the question:

"In 1.3 compression is prohibited (the field is still there, but it must not specify anything other than 0 = identity)"

10

Compression is not required, and support for it is up to the implementations on client and server. Not all servers or clients support it (it is mandatory to support uncompressed traffic).

Some implementations of compression create vulnerabilities in webapps and similar content, as attackers can use the compression to learn things about the encrypted secrets such as cookie values by varying URLs that they make the victim's browser request, and seeing which strings compress well or poorly. As such, it will generally be disabled in contexts where an attacker could partially control the content.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .