Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow setting root CA from string #563

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(pemContent string) *Client {
c.resty.SetRootCertificateFromString(pemContent)
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