From 561e83057fd9c48f2807f65a9d1eb20ebe61fb35 Mon Sep 17 00:00:00 2001 From: Mateusz Urbanek Date: Wed, 31 Jul 2024 16:18:06 +0200 Subject: [PATCH] feat: allow setting root CA from string Signed-off-by: Mateusz Urbanek --- client.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 9c4920185..89f9fa546 100644 --- a/client.go +++ b/client.go @@ -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 {