mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-13 11:05:46 +00:00
TLS: Support "InsecureCipherSuites"
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user