|
|
@@ -378,7 +378,16 @@ func (s *QUICNameServer) getConnection(ctx context.Context) (quic.Connection, er
|
|
|
|
|
|
func (s *QUICNameServer) openConnection(ctx context.Context) (quic.Connection, error) {
|
|
|
tlsConfig := tls.Config{
|
|
|
- ServerName: s.destination.Address.Domain(),
|
|
|
+ ServerName: func() string {
|
|
|
+ switch s.destination.Address.Family() {
|
|
|
+ case net.AddressFamilyIPv4, net.AddressFamilyIPv6:
|
|
|
+ return s.destination.Address.IP().String()
|
|
|
+ case net.AddressFamilyDomain:
|
|
|
+ return s.destination.Address.Domain()
|
|
|
+ default:
|
|
|
+ panic("unknown address family")
|
|
|
+ }
|
|
|
+ }(),
|
|
|
}
|
|
|
quicConfig := &quic.Config{
|
|
|
HandshakeIdleTimeout: handshakeIdleTimeout,
|