|
|
|
@ -366,52 +366,28 @@ func TestConfigurator_wrapTLS_BadCert(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
func TestConfig_ParseCiphers(t *testing.T) { |
|
|
|
|
testOk := strings.Join([]string{ |
|
|
|
|
"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", |
|
|
|
|
"TLS_RSA_WITH_AES_128_GCM_SHA256", |
|
|
|
|
"TLS_RSA_WITH_AES_256_GCM_SHA384", |
|
|
|
|
"TLS_RSA_WITH_AES_128_CBC_SHA256", |
|
|
|
|
"TLS_RSA_WITH_AES_128_CBC_SHA", |
|
|
|
|
"TLS_RSA_WITH_AES_256_CBC_SHA", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", |
|
|
|
|
"TLS_RSA_WITH_3DES_EDE_CBC_SHA", |
|
|
|
|
"TLS_RSA_WITH_RC4_128_SHA", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_RC4_128_SHA", |
|
|
|
|
"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", |
|
|
|
|
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", |
|
|
|
|
}, ",") |
|
|
|
|
ciphers := []uint16{ |
|
|
|
|
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_CBC_SHA, |
|
|
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_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_CBC_SHA, |
|
|
|
|
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_128_CBC_SHA256, |
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, |
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, |
|
|
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, |
|
|
|
|
tls.TLS_RSA_WITH_AES_128_GCM_SHA256, |
|
|
|
|
tls.TLS_RSA_WITH_AES_256_GCM_SHA384, |
|
|
|
|
tls.TLS_RSA_WITH_AES_128_CBC_SHA256, |
|
|
|
|
tls.TLS_RSA_WITH_AES_128_CBC_SHA, |
|
|
|
|
tls.TLS_RSA_WITH_AES_256_CBC_SHA, |
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, |
|
|
|
|
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, |
|
|
|
|
tls.TLS_RSA_WITH_RC4_128_SHA, |
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, |
|
|
|
|
tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, |
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, |
|
|
|
|
} |
|
|
|
|
v, err := ParseCiphers(testOk) |
|
|
|
|
require.NoError(t, err) |
|
|
|
|