From bd4e470e335b68abdadc97e276aafa10bc65a0a0 Mon Sep 17 00:00:00 2001 From: vcptr <51714622+vcptr@users.noreply.github.com> Date: Sun, 31 May 2020 02:19:34 +0800 Subject: [PATCH] tls use crypto std cipher suites --- transport/internet/tls/config.go | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/transport/internet/tls/config.go b/transport/internet/tls/config.go index 1d41ed4a..8833a4f5 100644 --- a/transport/internet/tls/config.go +++ b/transport/internet/tls/config.go @@ -187,23 +187,10 @@ func (c *Config) GetTLSConfig(opts ...Option) *tls.Config { } if !c.AllowInsecureCiphers && len(config.CipherSuites) == 0 { - config.CipherSuites = []uint16{ - tls.TLS_AES_128_GCM_SHA256, - tls.TLS_AES_256_GCM_SHA384, - tls.TLS_CHACHA20_POLY1305_SHA256, - - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, - tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, - tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + // use tls cipher suites from cryto/tls + config.CipherSuites = []uint16{} + for _, s := range tls.CipherSuites() { + config.CipherSuites = append(config.CipherSuites, s.ID) } }