Skip to content

Commit 561e830

Browse files
feat: allow setting root CA from string
Signed-off-by: Mateusz Urbanek <[email protected]>
1 parent d336c4d commit 561e830

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

client.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,18 @@ func (c *Client) updateHostURL() {
431431
)
432432
}
433433

434-
// SetRootCertificate adds a root certificate to the underlying TLS client config
434+
// SetRootCertificate adds a path to the root certificate to the underlying TLS client config.
435435
func (c *Client) SetRootCertificate(path string) *Client {
436436
c.resty.SetRootCertificate(path)
437437
return c
438438
}
439439

440+
// SetRootCertificateFromString adds a root certificate to the underlying TLS client config.
441+
func (c *Client) SetRootCertificateFromString(pemContent string) *Client {
442+
c.resty.SetRootCertificateFromString(pemContent)
443+
return c
444+
}
445+
440446
// SetToken sets the API token for all requests from this client
441447
// Only necessary if you haven't already provided the http client to NewClient() configured with the token.
442448
func (c *Client) SetToken(token string) *Client {

0 commit comments

Comments
 (0)