File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"io"
22
22
"io/ioutil"
23
23
"path/filepath"
24
+ "strconv"
24
25
25
26
"go.uber.org/zap"
26
27
)
@@ -34,6 +35,7 @@ type Options struct {
34
35
ServerName string `mapstructure:"server_name"` // only for client-side TLS config
35
36
ClientCAPath string `mapstructure:"client_ca"` // only for server-side TLS config for client auth
36
37
SkipHostVerify bool `mapstructure:"skip_host_verify"`
38
+ Ciphers string `mapstructure:"ciphers"`
37
39
certWatcher * certWatcher `mapstructure:"-"`
38
40
}
39
41
@@ -52,6 +54,14 @@ func (p *Options) Config(logger *zap.Logger) (*tls.Config, error) {
52
54
ServerName : p .ServerName ,
53
55
InsecureSkipVerify : p .SkipHostVerify ,
54
56
}
57
+ if len (p .Ciphers ) > 0 {
58
+ cs := make ([]uint16 , 1 )
59
+ value , err := strconv .ParseUint (p .Ciphers , 16 , 16 )
60
+ if err == nil {
61
+ cs [0 ] = uint16 (value )
62
+ tlsCfg .CipherSuites = cs
63
+ }
64
+ }
55
65
if p .ClientCAPath != "" {
56
66
certPool := x509 .NewCertPool ()
57
67
if err := addCertToPool (p .ClientCAPath , certPool ); err != nil {
You can’t perform that action at this time.
0 commit comments