MCPcopy Create free account
hub / github.com/cloudflare/cfssl / LoadClientCertificate

Function LoadClientCertificate

helpers/helpers.go:511–522  ·  view source on GitHub ↗

LoadClientCertificate load key/certificate from pem files

(certFile string, keyFile string)

Source from the content-addressed store, hash-verified

509
510// LoadClientCertificate load key/certificate from pem files
511func LoadClientCertificate(certFile string, keyFile string) (*tls.Certificate, error) {
512 if certFile != "" && keyFile != "" {
513 cert, err := tls.LoadX509KeyPair(certFile, keyFile)
514 if err != nil {
515 log.Criticalf("Unable to read client certificate from file: %s or key from file: %s", certFile, keyFile)
516 return nil, err
517 }
518 log.Debug("Client certificate loaded ")
519 return &cert, nil
520 }
521 return nil, nil
522}
523
524// CreateTLSConfig creates a tls.Config object from certs and roots
525func CreateTLSConfig(remoteCAs *x509.CertPool, cert *tls.Certificate) *tls.Config {

Callers 7

NewCFSSLFunction · 0.92
NewCFSSLProviderFunction · 0.92
getInfoFromRemoteFunction · 0.92
TestNewMutualTLSServerFunction · 0.92
TestClientCertParamsFunction · 0.85

Calls 2

CriticalfFunction · 0.92
DebugFunction · 0.92

Tested by 3

TestNewMutualTLSServerFunction · 0.74
TestClientCertParamsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…