@@ -1537,13 +1537,13 @@ func configureCipherSuites(ctx context.Context, logger slog.Logger, ciphers []st
1537
1537
if ! hasSupportedVersion (minTLS , maxTLS , cipher .SupportedVersions ) {
1538
1538
versions := make ([]string , 0 , len (cipher .SupportedVersions ))
1539
1539
for _ , sv := range cipher .SupportedVersions {
1540
- versions = append (versions , tls . VersionName (sv ))
1540
+ versions = append (versions , versionName (sv ))
1541
1541
}
1542
1542
logger .Warn (ctx , "cipher not supported for tls versions enabled, cipher will not be used" ,
1543
1543
slog .F ("cipher" , cipher .Name ),
1544
1544
slog .F ("cipher_supported_versions" , strings .Join (versions , "," )),
1545
- slog .F ("server_min_version" , tls . VersionName (minTLS )),
1546
- slog .F ("server_max_version" , tls . VersionName (maxTLS )),
1545
+ slog .F ("server_min_version" , versionName (minTLS )),
1546
+ slog .F ("server_max_version" , versionName (maxTLS )),
1547
1547
)
1548
1548
}
1549
1549
@@ -1567,7 +1567,7 @@ func configureCipherSuites(ctx context.Context, logger slog.Logger, ciphers []st
1567
1567
continue // v1.3 ignores configured cipher suites.
1568
1568
}
1569
1569
if ! covered {
1570
- missedVersions = append (missedVersions , tls . VersionName (version ))
1570
+ missedVersions = append (missedVersions , versionName (version ))
1571
1571
}
1572
1572
}
1573
1573
if len (missedVersions ) > 0 {
@@ -1631,6 +1631,25 @@ func hasSupportedVersion(min, max uint16, versions []uint16) bool {
1631
1631
return false
1632
1632
}
1633
1633
1634
+ // versionName is tls.VersionName in go 1.21.
1635
+ // Until the switch, the function is copied locally.
1636
+ func versionName (version uint16 ) string {
1637
+ switch version {
1638
+ case tls .VersionSSL30 :
1639
+ return "SSLv3"
1640
+ case tls .VersionTLS10 :
1641
+ return "TLS 1.0"
1642
+ case tls .VersionTLS11 :
1643
+ return "TLS 1.1"
1644
+ case tls .VersionTLS12 :
1645
+ return "TLS 1.2"
1646
+ case tls .VersionTLS13 :
1647
+ return "TLS 1.3"
1648
+ default :
1649
+ return fmt .Sprintf ("0x%04X" , version )
1650
+ }
1651
+ }
1652
+
1634
1653
func configureOIDCPKI (orig * oauth2.Config , keyFile string , certFile string ) (* oauthpki.Config , error ) {
1635
1654
// Read the files
1636
1655
keyData , err := os .ReadFile (keyFile )
0 commit comments