Skip to content

Commit

Permalink
Use default CAs if neither cert or cert path is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
nineinchnick authored and losipiuk committed Jun 2, 2023
1 parent 0969a6c commit 7593b22
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions trino/trino.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,17 @@ func newConn(dsn string) (*Conn, error) {
}
}

certPool := x509.NewCertPool()
certPool.AppendCertsFromPEM(cert)

httpClient = &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: certPool,
if len(cert) != 0 {
certPool := x509.NewCertPool()
certPool.AppendCertsFromPEM(cert)

httpClient = &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: certPool,
},
},
},
}
}
}

Expand Down

0 comments on commit 7593b22

Please sign in to comment.