Fix grpc dialer

This commit is contained in:
katexochen 2022-06-15 15:57:36 +02:00 committed by Paul Meyer
parent 4842d29aff
commit 85ba2657e1

View File

@ -28,7 +28,11 @@ func New(issuer atls.Issuer, validator atls.Validator, netDialer NetDialer) *Dia
// Dial creates a new grpc client connection to the given target using the atls validator.
func (d *Dialer) Dial(ctx context.Context, target string) (*grpc.ClientConn, error) {
credentials := atlscredentials.New(d.issuer, []atls.Validator{d.validator})
var validators []atls.Validator
if d.validator != nil {
validators = append(validators, d.validator)
}
credentials := atlscredentials.New(d.issuer, validators)
return grpc.DialContext(ctx, target,
d.grpcWithDialer(),