Skip to content

Commit

Permalink
Merge pull request #138 from projectdiscovery/bugfix-dns-data
Browse files Browse the repository at this point in the history
Fixing dns data store logic
  • Loading branch information
Mzack9999 committed Jun 21, 2023
2 parents b1cd237 + c87255e commit 27d4b44
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fastdialer/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ func (d *Dialer) dial(ctx context.Context, network, address string, shouldUseTLS
if impersonateStrategy == impersonate.None {
conn, err = tls.DialWithDialer(d.dialer, network, hostPort, tlsconfigCopy)
} else {
conn, err := d.dialer.DialContext(ctx, network, hostPort)
nativeConn, err := d.dialer.DialContext(ctx, network, hostPort)
if err != nil {
return conn, err
return nativeConn, err
}
// clone existing tls config
uTLSConfig := &utls.Config{
Expand All @@ -250,9 +250,9 @@ func (d *Dialer) dial(ctx context.Context, network, address string, shouldUseTLS
}
var uTLSConn *utls.UConn
if impersonateStrategy == impersonate.Random {
uTLSConn = utls.UClient(conn, uTLSConfig, utls.HelloRandomized)
uTLSConn = utls.UClient(nativeConn, uTLSConfig, utls.HelloRandomized)
} else if impersonateStrategy == impersonate.Custom {
uTLSConn = utls.UClient(conn, uTLSConfig, utls.HelloCustom)
uTLSConn = utls.UClient(nativeConn, uTLSConfig, utls.HelloCustom)
clientHelloSpec := utls.ClientHelloSpec(ptrutil.Safe(impersonateIdentity))
if err := uTLSConn.ApplyPreset(&clientHelloSpec); err != nil {
return nil, err
Expand All @@ -261,7 +261,7 @@ func (d *Dialer) dial(ctx context.Context, network, address string, shouldUseTLS
if err := uTLSConn.Handshake(); err != nil {
return nil, err
}
return uTLSConn, nil
conn = uTLSConn
}
} else if shouldUseZTLS {
ztlsconfigCopy := ztlsconfig.Clone()
Expand Down

0 comments on commit 27d4b44

Please sign in to comment.