Skip to content

Commit

Permalink
Explicitly check server name in client TLS configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
  • Loading branch information
JAORMX committed Nov 29, 2024
1 parent 258f3e2 commit 6bb1373
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 6bb1373

Please sign in to comment.