Skip to content

Commit

Permalink
Merge pull request #209 from Tantalor93/fixresolution
Browse files Browse the repository at this point in the history
do not pre resolve server hostnames to mitigate cert validation errors
  • Loading branch information
Tantalor93 committed Dec 28, 2023
2 parents 489b7f7 + cfd468b commit dbd8e60
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
12 changes: 0 additions & 12 deletions cmd/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,6 @@ func (b *Benchmark) prepare() error {

b.addPortIfMissing()

if !b.useDoH && !b.useQuic {
host, port, err := net.SplitHostPort(b.Server)
if err != nil {
return errors.New("failed to parse --server")
}
addr, err := net.ResolveIPAddr("ip", host)
if err != nil {
return errors.New("failed to resolve --server address")
}
b.Server = net.JoinHostPort(addr.String(), port)
}

if b.Count == 0 && b.Duration == 0 {
b.Count = 1
}
Expand Down
15 changes: 0 additions & 15 deletions cmd/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,21 +638,6 @@ func TestBenchmark_prepare(t *testing.T) {
benchmark: Benchmark{Server: "fddd:dddd::"},
wantServer: "[fddd:dddd::]:53",
},
{
name: "server - resolve addr for plain DNS",
benchmark: Benchmark{Server: "google-public-dns-a.google.com"},
wantServer: "8.8.8.8:53",
},
{
name: "server - resolve addr with port for plain DNS",
benchmark: Benchmark{Server: "google-public-dns-a.google.com:53"},
wantServer: "8.8.8.8:53",
},
{
name: "server - resolve addr for DoT",
benchmark: Benchmark{Server: "google-public-dns-a.google.com", DOT: true},
wantServer: "8.8.8.8:853",
},
{
name: "server - DoT with IP address",
benchmark: Benchmark{Server: "8.8.8.8", DOT: true},
Expand Down

0 comments on commit dbd8e60

Please sign in to comment.