Skip to content

Commit cd119fd

Browse files
committed
fix(core): when passing a string for CA certificate check if .TLSClientConfig.RootCAs is nil and create a new CertPool if it is.
1 parent 4ba2bf6 commit cd119fd

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Bug fixes
44
- `oauth2` client now correctly sets the `scopes` and `audience` fields when invoked with explicit values.
5+
- `core` when passing a string for CA certificate check if `.TLSClientConfig.RootCAs` is nil and create a new `CertPool` if it is.
56

67
## Chores
78
- Update `stretchr/testify` to `v1.10.0`

auth_providers/auth_core.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ func (c *CommandAuthConfig) BuildTransport() (*http.Transport, error) {
322322
return &output, fmt.Errorf("failed to append custom CA cert to pool")
323323
}
324324
} else {
325+
if output.TLSClientConfig.RootCAs == nil {
326+
output.TLSClientConfig.RootCAs = x509.NewCertPool()
327+
}
325328
// Append your custom cert to the pool
326329
if ok := output.TLSClientConfig.RootCAs.AppendCertsFromPEM([]byte(c.CommandCACert)); !ok {
327330
return &output, fmt.Errorf("failed to append custom CA cert to pool")

tag.sh

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
RC_VERSION=rc.2
2-
TAG_VERSION_1=v1.0.0-$RC_VERSION
1+
RC_VERSION=rc.0
2+
TAG_VERSION_1=v1.1.2-$RC_VERSION
33
git tag -d $TAG_VERSION_1 || true
44
git tag $TAG_VERSION_1
55
git push origin $TAG_VERSION_1

0 commit comments

Comments
 (0)