"SupportTicketsWithSessionID": "TODO: first pass, this should be fixed",
"NoNullCompression-TLS12": "TODO: first pass, this should be fixed",
"KeyUpdate-RequestACK": "TODO: first pass, this should be fixed",
- "IgnoreClientVersionOrder": "RFC 8446 4.2.1 says supported_versions is in client pref order",
"SupportedVersionSelection-TLS12": "TODO: first pass, this should be fixed",
"DuplicateExtensionServer-TLS-TLS1": "TODO: first pass, this should be fixed",
"DuplicateExtensionClient-TLS-TLS1": "TODO: first pass, this should be fixed",
}
// mutualVersion returns the protocol version to use given the advertised
-// versions of the peer. Priority is given to the peer preference order.
+// versions of the peer. The highest supported version is preferred.
func (c *Config) mutualVersion(isClient bool, peerVersions []uint16) (uint16, bool) {
supportedVersions := c.supportedVersions(isClient)
- for _, v := range peerVersions {
- if slices.Contains(supportedVersions, v) {
+ for _, v := range supportedVersions {
+ if slices.Contains(peerVersions, v) {
return v, true
}
}