mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
fix tls.AllowInsecureCiphers
This commit is contained in:
parent
f9436b3556
commit
682b28cbda
@ -155,7 +155,7 @@ func (c *Config) GetTLSConfig(opts ...Option) *tls.Config {
|
||||
opt(config)
|
||||
}
|
||||
|
||||
if c.AllowInsecureCiphers && len(config.CipherSuites) == 0 {
|
||||
if !c.AllowInsecureCiphers && len(config.CipherSuites) == 0 {
|
||||
config.CipherSuites = []uint16{
|
||||
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
|
||||
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
|
||||
|
@ -62,3 +62,14 @@ func TestExpiredCertificate(t *testing.T) {
|
||||
assert(err, IsNil)
|
||||
assert(x509Cert.NotAfter.After(time.Now()), IsTrue)
|
||||
}
|
||||
|
||||
func TestInsecureCertificates(t *testing.T) {
|
||||
c := &Config{
|
||||
AllowInsecureCiphers: true,
|
||||
}
|
||||
|
||||
tlsConfig := c.GetTLSConfig()
|
||||
if len(tlsConfig.CipherSuites) > 0 {
|
||||
t.Fatal("Unexpected tls cipher suites list: ", tlsConfig.CipherSuites)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user