TLS: Support "InsecureCipherSuites"

This commit is contained in:
patterniha
2026-07-09 15:47:51 +03:30
parent 1aabe7ea78
commit 600e701119
2 changed files with 15 additions and 2 deletions
+6 -2
View File
@@ -450,9 +450,13 @@ func (c *Config) GetTLSConfig(opts ...Option) *tls.Config {
for _, s := range tls.CipherSuites() {
id[s.Name] = s.ID
}
for _, s := range tls.InsecureCipherSuites() {
id[s.Name] = s.ID
}
for n := range strings.SplitSeq(c.CipherSuites, ":") {
if id[n] != 0 {
config.CipherSuites = append(config.CipherSuites, id[n])
n = strings.TrimSpace(n)
if v, ok := id[n]; ok {
config.CipherSuites = append(config.CipherSuites, v)
}
}
}
+9
View File
@@ -147,6 +147,11 @@ func GeneraticUClient(c net.Conn, config *tls.Config) *utls.UConn {
}
func copyConfig(c *tls.Config) *utls.Config {
curvePreferences := make([]utls.CurveID, 0, len(c.CurvePreferences))
for _, curve := range c.CurvePreferences {
curvePreferences = append(curvePreferences, utls.CurveID(curve))
}
config := &utls.Config{
Rand: c.Rand,
RootCAs: c.RootCAs,
@@ -156,6 +161,10 @@ func copyConfig(c *tls.Config) *utls.Config {
KeyLogWriter: c.KeyLogWriter,
EncryptedClientHelloConfigList: c.EncryptedClientHelloConfigList,
NextProtos: c.NextProtos,
CipherSuites: c.CipherSuites,
MinVersion: c.MinVersion,
MaxVersion: c.MaxVersion,
CurvePreferences: curvePreferences,
}
return config
}