feat(netxlite): implement LookupHTTPS (#514)
This new API call performs DNS lookups for HTTPS records. Part of https://github.com/ooni/probe/issues/1733 and diff has been extracted from https://github.com/ooni/probe-cli/pull/506.
This commit is contained in:
parent
c6b69cbee8
commit
8b9fe1a160
13 changed files with 621 additions and 24 deletions
|
|
@ -1,6 +1,8 @@
|
|||
package netxlite
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
|
|
@ -43,6 +45,17 @@ func TestResolverLegacyAdapter(t *testing.T) {
|
|||
}
|
||||
r.CloseIdleConnections() // does not crash
|
||||
})
|
||||
|
||||
t.Run("for LookupHTTPS", func(t *testing.T) {
|
||||
r := NewResolverLegacyAdapter(&net.Resolver{})
|
||||
https, err := r.LookupHTTPS(context.Background(), "x.org")
|
||||
if !errors.Is(err, ErrNoDNSTransport) {
|
||||
t.Fatal("not the error we expected")
|
||||
}
|
||||
if https != nil {
|
||||
t.Fatal("expected nil result")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestDialerLegacyAdapter(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue