MCPcopy Create free account
hub / github.com/XTLS/Go / supportedVersions

Method supportedVersions

common.go:981–997  ·  view source on GitHub ↗
(isClient bool)

Source from the content-addressed store, hash-verified

979const roleServer = false
980
981func (c *Config) supportedVersions(isClient bool) []uint16 {
982 versions := make([]uint16, 0, len(supportedVersions))
983 for _, v := range supportedVersions {
984 if (c == nil || c.MinVersion == 0) &&
985 isClient && v < VersionTLS12 {
986 continue
987 }
988 if c != nil && c.MinVersion != 0 && v < c.MinVersion {
989 continue
990 }
991 if c != nil && c.MaxVersion != 0 && v > c.MaxVersion {
992 continue
993 }
994 versions = append(versions, v)
995 }
996 return versions
997}
998
999func (c *Config) maxSupportedVersion(isClient bool) uint16 {
1000 supportedVersions := c.supportedVersions(isClient)

Callers 3

maxSupportedVersionMethod · 0.95
mutualVersionMethod · 0.95
makeClientHelloMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected