I propose to add a func VersionName(version uint16) string method that returns a string representation (TLSv1.0, TLSv1.1, ...) given a version id.
Currently crypto/tls provides similar functionality for the cipher suites but not for the version. I've seen myself and others implementing this in our codes to print it in logs and other places, but this is far from ideal as, for example, if a new protocol is added in the future, that code would be outdated.
I couldn't find any related issue or ongoing work so I'll be opening a PR.
I propose to add a
func VersionName(version uint16) stringmethod that returns a string representation (TLSv1.0,TLSv1.1, ...) given a version id.Currently
crypto/tlsprovides similar functionality for the cipher suites but not for the version. I've seen myself and others implementing this in our codes to print it in logs and other places, but this is far from ideal as, for example, if a new protocol is added in the future, that code would be outdated.I couldn't find any related issue or ongoing work so I'll be opening a PR.