Skip to content

Commit

Permalink
Add type assertion check (spiffe#5058)
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Kamm <[email protected]>
  • Loading branch information
InverseIntegral committed Nov 27, 2024
1 parent 1b407c2 commit 4ad4ee7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/server/plugin/keymanager/hashicorpvault/vault_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,13 @@ func (c *ClientConfig) configureTLS(vc *vapi.Config) error {
if vc.HttpClient == nil {
vc.HttpClient = vapi.DefaultConfig().HttpClient
}
clientTLSConfig := vc.HttpClient.Transport.(*http.Transport).TLSClientConfig

transport, ok := vc.HttpClient.Transport.(*http.Transport)
if !ok {
return status.Errorf(codes.Internal, "http client transport is of incorrect type. Expected is %T but was %T", transport, vc.HttpClient.Transport)
}

clientTLSConfig := transport.TLSClientConfig

var clientCert tls.Certificate
foundClientCert := false
Expand Down

0 comments on commit 4ad4ee7

Please sign in to comment.