Fix panic if no certificates are supplied by client

Fixes #1637
This commit is contained in:
Jeff Mitchell
2016-07-21 10:20:41 -04:00
parent 2701ea16d1
commit c664c4091b

View File

@@ -143,6 +143,10 @@ func (b *backend) verifyCredentials(req *logical.Request) (*ParsedCert, *logical
}
connState := req.Connection.ConnState
if connState.PeerCertificates == nil || len(connState.PeerCertificates) == 0 {
return nil, logical.ErrorResponse("client certificate must be supplied"), nil
}
// Load the trusted certificates
roots, trusted, trustedNonCAs := b.loadTrustedCerts(req.Storage)