MCPcopy Index your code
hub / github.com/PasarGuard/node / LoadTLSCredentials

Function LoadTLSCredentials

pkg/tlsutil/tls.go:12–23  ·  view source on GitHub ↗
(cert, key string)

Source from the content-addressed store, hash-verified

10)
11
12func LoadTLSCredentials(cert, key string) (*tls.Config, error) {
13 serverCert, err := tls.LoadX509KeyPair(cert, key)
14 if err != nil {
15 return nil, err
16 }
17
18 config := &tls.Config{
19 Certificates: []tls.Certificate{serverCert},
20 ClientAuth: tls.NoClientCert,
21 }
22 return config, nil
23}
24
25func LoadClientPool(cert string) (*x509.CertPool, error) {
26 pemServerCA, err := os.ReadFile(cert)

Callers 3

TestMainFunction · 0.92
TestMainFunction · 0.92
mainFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestMainFunction · 0.74
TestMainFunction · 0.74