@@ -25,23 +25,30 @@ var kmipClient *kmipclient.Client
25
25
func SetupKmipFlags (command * cobra.Command , cust CustomizeFunc ) {
26
26
debug := command .PersistentFlags ().BoolP ("debug" , "d" , false , "Activate debug mode" )
27
27
// retry := command.PersistentFlags().Uint32("retry", 4, "Maximum number of HTTP retries")
28
- // timeout := command.PersistentFlags().Duration("timeout", okms.DefaultHTTPClientTimeout, "Timeout duration for HTTP requests")
28
+ timeout := command .PersistentFlags ().Duration ("timeout" , 0 , "Timeout duration for KMIP requests" )
29
+ noCcv := command .PersistentFlags ().Bool ("no-ccv" , false , "Disable kmip client correlation value" )
30
+ tls12Ciphers := command .PersistentFlags ().StringArray ("tls12-ciphers" , nil , "List of TLS 1.2 ciphers to use" )
29
31
30
32
f := func (* []kmipclient.Option ) {}
31
33
if cust != nil {
32
34
f = cust (command )
33
35
}
34
36
35
37
config .SetupEndpointFlags (command , "kmip" , func (command * cobra.Command , cfg config.EndpointConfig ) {
36
- middlewares := []kmipclient.Middleware {
37
- kmipclient .CorrelationValueMiddleware (uuid .NewString ),
38
+ middlewares := []kmipclient.Middleware {}
39
+ if ! * noCcv {
40
+ middlewares = append (middlewares , kmipclient .CorrelationValueMiddleware (uuid .NewString ))
38
41
}
39
42
if * debug {
40
43
middlewares = append (middlewares , kmipclient .DebugMiddleware (os .Stderr , ttlv .MarshalXML ))
41
44
}
45
+ if * timeout > 0 {
46
+ middlewares = append (middlewares , kmipclient .TimeoutMiddleware (* timeout ))
47
+ }
42
48
opts := []kmipclient.Option {
43
49
kmipclient .WithTlsConfig (cfg .TlsConfig ("" )),
44
50
kmipclient .WithMiddlewares (middlewares ... ),
51
+ kmipclient .WithTlsCipherSuiteNames (* tls12Ciphers ... ),
45
52
}
46
53
f (& opts )
47
54
kmipClient = exit .OnErr2 (kmipclient .Dial (
0 commit comments