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

Function Test_Client_SetRootCertificateFromString

client/client_test.go:1992–2004  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1990}
1991
1992func Test_Client_SetRootCertificateFromString(t *testing.T) {
1993 t.Parallel()
1994
1995 file, err := os.Open("../.github/testdata/ssl.pem")
1996 defer func() { require.NoError(t, file.Close()) }()
1997 require.NoError(t, err)
1998
1999 pem, err := io.ReadAll(file)
2000 require.NoError(t, err)
2001
2002 client := New().SetRootCertificateFromString(string(pem))
2003 require.NotNil(t, client.TLSConfig().RootCAs)
2004}
2005
2006func Test_Client_R(t *testing.T) {
2007 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
CloseMethod · 0.65
TLSConfigMethod · 0.65

Tested by

no test coverage detected