Skip to content

Commit

Permalink
Explicitly check server name in client TLS configuration (#5095)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Antonio Osorio <[email protected]>
  • Loading branch information
JAORMX authored Dec 2, 2024
1 parent c7b6f8d commit 532e3be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/util/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ func GetGrpcConnection(
}
}

credentialOpts := credentials.NewTLS(&tls.Config{MinVersion: tls.VersionTLS13})
credentialOpts := credentials.NewTLS(&tls.Config{
MinVersion: tls.VersionTLS13,
ServerName: grpc_host,
})
if allowInsecure {
credentialOpts = insecure.NewCredentials()
}
Expand Down

0 comments on commit 532e3be

Please sign in to comment.