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