@@ -33,7 +33,26 @@ type opts struct {
33
33
func (o * opts ) tlsConfig () (* tls.Config , error ) {
34
34
cfg := o .tlsCfg
35
35
if cfg == nil {
36
- cfg = & tls.Config {}
36
+ cfg = & tls.Config {
37
+ MinVersion : tls .VersionTLS12 , // As required by KMIP 1.4 spec
38
+
39
+ // // TODO: Make cipher suites configurable and do not add by default legacy ones
40
+ // CipherSuites: []uint16{
41
+ // // Mandatory support as per KMIP 1.4 spec
42
+ // // tls.TLS_RSA_WITH_AES_256_CBC_SHA256, // Not supported in Go
43
+ // tls.TLS_RSA_WITH_AES_128_CBC_SHA256, // insecure
44
+
45
+ // // Optional support as per KMIP 1.4 spec
46
+ // tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
47
+ // tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
48
+ // tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
49
+ // tls.TLS_RSA_WITH_AES_128_CBC_SHA, // insecure
50
+ // tls.TLS_RSA_WITH_AES_256_CBC_SHA, // insecure
51
+ // tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, // insecure
52
+ // tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, // insecure
53
+ // tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, // insecure
54
+ // },
55
+ }
37
56
}
38
57
if cfg .RootCAs == nil {
39
58
if len (o .rootCAs ) > 0 {
@@ -52,27 +71,6 @@ func (o *opts) tlsConfig() (*tls.Config, error) {
52
71
if cfg .ServerName == "" {
53
72
cfg .ServerName = o .serverName
54
73
}
55
- if cfg .MinVersion == 0 {
56
- cfg .MinVersion = tls .VersionTLS12 // As required by KMIP 1.4 spec
57
- }
58
- if len (cfg .CipherSuites ) == 0 {
59
- cfg .CipherSuites = []uint16 {
60
- // Mandatory support as per KMIP 1.4 spec
61
- // tls.TLS_RSA_WITH_AES_256_CBC_SHA256, // Not supported in Go
62
- tls .TLS_RSA_WITH_AES_128_CBC_SHA256 ,
63
-
64
- // Optional support as per KMIP 1.4 spec
65
- tls .TLS_RSA_WITH_AES_128_CBC_SHA ,
66
- tls .TLS_RSA_WITH_AES_256_CBC_SHA ,
67
- tls .TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ,
68
- tls .TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 ,
69
- tls .TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA ,
70
- tls .TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 ,
71
- tls .TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ,
72
- tls .TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ,
73
- tls .TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 ,
74
- }
75
- }
76
74
return cfg , nil
77
75
}
78
76
0 commit comments