MCPcopy
hub / github.com/gofiber/fiber / SetRootCertificateFromString

Method SetRootCertificateFromString

client/client.go:343–355  ·  view source on GitHub ↗

SetRootCertificateFromString adds one or more root certificates from a string to the client's TLS configuration.

(pem string)

Source from the content-addressed store, hash-verified

341
342// SetRootCertificateFromString adds one or more root certificates from a string to the client's TLS configuration.
343func (c *Client) SetRootCertificateFromString(pem string) *Client {
344 config := c.TLSConfig()
345
346 if config.RootCAs == nil {
347 config.RootCAs = x509.NewCertPool()
348 }
349
350 if !config.RootCAs.AppendCertsFromPEM([]byte(pem)) {
351 c.logger.Panicf("client: %v", ErrFailedToAppendCert)
352 }
353
354 return c
355}
356
357// SetProxyURL sets the proxy URL for the client. This affects all subsequent requests.
358func (c *Client) SetProxyURL(proxyURL string) error {

Calls 2

TLSConfigMethod · 0.95
PanicfMethod · 0.65