MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / NewContextWithClientCertificate

Function NewContextWithClientCertificate

pkg/auth/mtls/context.go:31–33  ·  view source on GitHub ↗

NewContextWithClientCertificate returns a context derived from parent that contains the client TLS certificate.

(parent context.Context, cert *x509.Certificate)

Source from the content-addressed store, hash-verified

29// NewContextWithClientCertificate returns a context derived from parent that contains
30// the client TLS certificate.
31func NewContextWithClientCertificate(parent context.Context, cert *x509.Certificate) context.Context {
32 return context.WithValue(parent, clientCertificateContextKey, cert)
33}
34
35// ClientCertificateFromContext returns the certificate from the context if present.
36// If the certificate is not present in the context, it tries to extract it from the peer.

Callers 3

TestTLSCertVerificationFunction · 0.92
ProxyHeadersFunction · 0.92
interceptMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestTLSCertVerificationFunction · 0.74