MCPcopy
hub / github.com/caddyserver/caddy / getTLSPeerCert

Function getTLSPeerCert

modules/caddyhttp/replacer.go:560–565  ·  view source on GitHub ↗

getTLSPeerCert retrieves the first peer certificate from a TLS session. Returns nil if no peer cert is in use.

(cs *tls.ConnectionState)

Source from the content-addressed store, hash-verified

558// getTLSPeerCert retrieves the first peer certificate from a TLS session.
559// Returns nil if no peer cert is in use.
560func getTLSPeerCert(cs *tls.ConnectionState) *x509.Certificate {
561 if len(cs.PeerCertificates) == 0 {
562 return nil
563 }
564 return cs.PeerCertificates[0]
565}
566
567type requestID struct {
568 value string

Callers 1

getReqTLSReplacementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected