Skip to content

Commit 0b6ff5a

Browse files
Use TLS config helper to build config (#10130)
1 parent 2a8d0ab commit 0b6ff5a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

goldmane/pkg/client/tls.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121

2222
"github.com/sirupsen/logrus"
2323
"google.golang.org/grpc/credentials"
24+
25+
calicotls "github.com/projectcalico/calico/crypto/pkg/tls"
2426
)
2527

2628
// ClientCredentials returns the transport credentials for a Goldmane gRPC client, configured to
@@ -55,8 +57,8 @@ func tlsConfig(cert, key, caFile string) (*tls.Config, error) {
5557
caCertPool.AppendCertsFromPEM(caCert)
5658

5759
// Create TLS config.
58-
return &tls.Config{
59-
Certificates: []tls.Certificate{certificate},
60-
RootCAs: caCertPool,
61-
}, nil
60+
cfg := calicotls.NewTLSConfig()
61+
cfg.Certificates = []tls.Certificate{certificate}
62+
cfg.RootCAs = caCertPool
63+
return cfg, nil
6264
}

0 commit comments

Comments
 (0)