Skip to content

Commit

Permalink
Merge pull request vmware#2400 from embano1/issue-2399
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Gasch committed May 4, 2021
2 parents 82b771e + f3645a9 commit da4f74c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions vim25/soap/client.go
Expand Up @@ -224,15 +224,17 @@ func (c *Client) NewServiceClient(path string, namespace string) *Client {
return client
}

// SetRootCAs defines the set of root certificate authorities
// that clients use when verifying server certificates.
// By default TLS uses the host's root CA set.
// SetRootCAs defines the set of PEM-encoded file locations of root certificate
// authorities the client uses when verifying server certificates instead of the
// TLS defaults which uses the host's root CA set. Multiple PEM file locations
// can be specified using the OS-specific PathListSeparator.
//
// See: http.Client.Transport.TLSClientConfig.RootCAs
func (c *Client) SetRootCAs(file string) error {
// See: http.Client.Transport.TLSClientConfig.RootCAs and
// https://pkg.go.dev/os#PathListSeparator
func (c *Client) SetRootCAs(pemPaths string) error {
pool := x509.NewCertPool()

for _, name := range filepath.SplitList(file) {
for _, name := range filepath.SplitList(pemPaths) {
pem, err := ioutil.ReadFile(filepath.Clean(name))
if err != nil {
return err
Expand Down

0 comments on commit da4f74c

Please sign in to comment.