package tlsauth import ( "crypto/x509" sr "tildegit.org/tjp/sliderule" ) // Identity returns the client certificate for the request or nil if there is none. func Identity(request *sr.Request) *x509.Certificate { if request.TLSState == nil || len(request.TLSState.PeerCertificates) == 0 { return nil } return request.TLSState.PeerCertificates[0] }