Skip to content

Commit aa36ac4

Browse files
author
Johan Thomsen
committed
Ensure nil is passed to client.NewServer instead of an empty tlsConfig struct
1 parent 519f8db commit aa36ac4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cert/cert.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type CA struct {
4242
}
4343

4444
func (ca *CA) getRemoteCert() ([]byte, error) {
45-
var tlsConfig tls.Config
45+
var tlsConfig *tls.Config
4646
if ca.RootCACert != "" {
4747
rootCABytes, err := ioutil.ReadFile(ca.RootCACert)
4848
if err != nil {
@@ -54,12 +54,12 @@ func (ca *CA) getRemoteCert() ([]byte, error) {
5454
if !ok {
5555
return nil, errors.New("failed to parse rootCA certs")
5656
}
57-
tlsConfig = tls.Config{
57+
tlsConfig = &tls.Config{
5858
RootCAs: rootCaCertPool,
5959
}
6060
}
6161

62-
remote := client.NewServerTLS(ca.Remote, &tlsConfig)
62+
remote := client.NewServerTLS(ca.Remote, tlsConfig)
6363
infoReq := &info.Req{
6464
Label: ca.Label,
6565
Profile: ca.Profile,

0 commit comments

Comments
 (0)