Added error message (#17904)

* Added error message

* Added changelog

* Grammar Chagne

* Changed wording
This commit is contained in:
divyaac 2022-11-11 11:04:10 -08:00 committed by GitHub
parent 065782e75d
commit 036bd45ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -62,6 +62,9 @@ func (b *backend) pathLoginResolveRole(ctx context.Context, req *logical.Request
} }
func (b *backend) pathLoginAliasLookahead(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) { func (b *backend) pathLoginAliasLookahead(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
if req.Connection == nil || req.Connection.ConnState == nil {
return nil, fmt.Errorf("tls connection not found")
}
clientCerts := req.Connection.ConnState.PeerCertificates clientCerts := req.Connection.ConnState.PeerCertificates
if len(clientCerts) == 0 { if len(clientCerts) == 0 {
return nil, fmt.Errorf("no client certificate found") return nil, fmt.Errorf("no client certificate found")

3
changelog/17904.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
credential/cert: adds error message if no tls connection is found during the AliasLookahead operation
```