crypto/tls: make maxHandshake larger or configurable #50773
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
I expected the connection to succeed.
What did you see instead?
tls: handshake message of length 110013 bytes exceeds maximum of 65536 bytes
The limit is defined here:
and it says that the protocol max is 16 MB, not 64 KiB. I assume this hard limit is to mitigate resource exhaustion attacks, but it would be preferable if it was configurable.
Context
We dynamically generate certificates for mTLS within and across clusters and configure which services are allowed to open connections between each other using Subject Alternative Names. In extreme cases a service that needs to communicate with many other services could have a certificate that's larger than this limit.
This isn't a problem right now but a limit of 64 KiB provides a fairly small and uncomfortable safety buffer. Is there a reason that this limit is not configurable?
This issue is related to #35153 where @FiloSottile says "Documenting something makes it a backwards compatibility promise". Is making it configurable still possible while preserving backwards compatibility in the future?
The text was updated successfully, but these errors were encountered: