Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
roblaszczak committed Jan 29, 2022
2 parents 59b07dd + 766b61c commit 33af2a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion trainings/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"crypto/x509"
"runtime"

"github.com/ThreeDotsLabs/cli/internal"
"github.com/pkg/errors"
Expand Down Expand Up @@ -47,9 +48,12 @@ func (h *Handlers) newGrpcClientWithAddr(ctx context.Context, addr string, insec
opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{InsecureSkipVerify: true})))
} else {
systemRoots, err := x509.SystemCertPool()
if err != nil {
if err != nil && runtime.GOOS != "windows" {
panic(errors.Wrap(err, "cannot load root CA cert"))
}
if systemRoots == nil {
systemRoots = x509.NewCertPool()
}
creds := credentials.NewTLS(&tls.Config{
RootCAs: systemRoots,
MinVersion: tls.VersionTLS12,
Expand Down

0 comments on commit 33af2a4

Please sign in to comment.