Skip to content

Commit 4a7310c

Browse files
Rajdeep Kaurclock21am
Rajdeep Kaur
authored andcommittedMay 23, 2021
Add: support specifying cipher suites in tls connection jaegertracing#3019
Signed-off-by: Rajdeep Kaur <rajdeep51994@gmail.com>
1 parent f0d0518 commit 4a7310c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎pkg/config/tlscfg/options.go

+10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"io"
2222
"io/ioutil"
2323
"path/filepath"
24+
"strconv"
2425

2526
"go.uber.org/zap"
2627
)
@@ -34,6 +35,7 @@ type Options struct {
3435
ServerName string `mapstructure:"server_name"` // only for client-side TLS config
3536
ClientCAPath string `mapstructure:"client_ca"` // only for server-side TLS config for client auth
3637
SkipHostVerify bool `mapstructure:"skip_host_verify"`
38+
Ciphers string `mapstructure:"ciphers"`
3739
certWatcher *certWatcher `mapstructure:"-"`
3840
}
3941

@@ -52,6 +54,14 @@ func (p *Options) Config(logger *zap.Logger) (*tls.Config, error) {
5254
ServerName: p.ServerName,
5355
InsecureSkipVerify: p.SkipHostVerify,
5456
}
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+
}
5565
if p.ClientCAPath != "" {
5666
certPool := x509.NewCertPool()
5767
if err := addCertToPool(p.ClientCAPath, certPool); err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.