@@ -645,21 +645,6 @@ func BlockingDial(ctx context.Context, network, address string, creds credential
645
645
writeResult : writeResult ,
646
646
}
647
647
648
- dialer := func (ctx context.Context , address string ) (net.Conn , error ) {
649
- // NB: We *could* handle the TLS handshake ourselves, in the custom
650
- // dialer (instead of customizing both the dialer and the credentials).
651
- // But that requires using insecure.NewCredentials() dial transport
652
- // option (so that the gRPC library doesn't *also* try to do a
653
- // handshake). And that would mean that the library would send the
654
- // wrong ":scheme" metaheader to servers: it would send "http" instead
655
- // of "https" because it is unaware that TLS is actually in use.
656
- conn , err := (& net.Dialer {}).DialContext (ctx , network , address )
657
- if err != nil {
658
- writeResult (err )
659
- }
660
- return conn , err
661
- }
662
-
663
648
// Even with grpc.FailOnNonTempDialError, this call will usually timeout in
664
649
// the face of TLS handshake errors. So we can't rely on grpc.WithBlock() to
665
650
// know when we're done. So we run it in a goroutine and then use result
@@ -670,7 +655,7 @@ func BlockingDial(ctx context.Context, network, address string, creds credential
670
655
opts = append ([]grpc.DialOption {grpc .FailOnNonTempDialError (true )}, opts ... )
671
656
// But we don't want caller to be able to override these two, so we put
672
657
// them *after* the explicitly provided options.
673
- opts = append (opts , grpc .WithBlock (), grpc .WithContextDialer ( dialer ), grpc . WithTransportCredentials (creds ))
658
+ opts = append (opts , grpc .WithBlock (), grpc .WithTransportCredentials (creds ))
674
659
675
660
conn , err := grpc .DialContext (ctx , address , opts ... )
676
661
var res interface {}
0 commit comments