VersionTLS10,
}
- func (c *Config) supportedVersions() []uint16 {
+ // debugEnableTLS10 enables TLS 1.0. See issue 45428.
+ var debugEnableTLS10 = godebug.Get("tls10default") == "1"
+
+ // roleClient and roleServer are meant to call supportedVersions and parents
+ // with more readability at the callsite.
+ const roleClient = true
+ const roleServer = false
+
+ func (c *Config) supportedVersions(isClient bool) []uint16 {
versions := make([]uint16, 0, len(supportedVersions))
for _, v := range supportedVersions {
+ if needFIPS() && (v < fipsMinVersion(c) || v > fipsMaxVersion(c)) {
+ continue
+ }
+ if (c == nil || c.MinVersion == 0) && !debugEnableTLS10 &&
+ isClient && v < VersionTLS12 {
+ continue
+ }
if c != nil && c.MinVersion != 0 && v < c.MinVersion {
continue
}