NewContextWithClientCertificate returns a context derived from parent that contains the client TLS certificate.
(parent context.Context, cert *x509.Certificate)
| 29 | // NewContextWithClientCertificate returns a context derived from parent that contains |
| 30 | // the client TLS certificate. |
| 31 | func 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. |
no outgoing calls