Skip to content

Commit

Permalink
feat: allow setting root CA from string
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Urbanek <[email protected]>
  • Loading branch information
shanduur-akamai committed Aug 6, 2024
1 parent d336c4d commit 4823b52
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,18 @@ func (c *Client) updateHostURL() {
)
}

// SetRootCertificate adds a root certificate to the underlying TLS client config
// SetRootCertificate adds a path to the root certificate to the underlying TLS client config.
func (c *Client) SetRootCertificate(path string) *Client {
c.resty.SetRootCertificate(path)
return c
}

// SetRootCertificateFromString adds a root certificate to the underlying TLS client config.
func (c *Client) SetRootCertificateFromString(ca string) *Client {
c.resty.SetRootCertificateFromString(ca)
return c
}

// SetToken sets the API token for all requests from this client
// Only necessary if you haven't already provided the http client to NewClient() configured with the token.
func (c *Client) SetToken(token string) *Client {
Expand Down

0 comments on commit 4823b52

Please sign in to comment.