Commit Graph

21 Commits

Author SHA1 Message Date
XOR-op
5ab85e297d feat(WIP): change relevant types 2023-06-06 12:12:09 -07:00
dAxpeDDa
1d9d50cbe0 Return Self from AsyncResolver::new() 2023-05-22 11:04:18 +02:00
XOR-op
c7550e1efc support future for openssl 2023-03-04 11:03:13 -08:00
XOR-op
3ccc10496d support future for native-tls 2023-03-04 11:03:13 -08:00
XOR-op
03af149076 fix clippy and compile errors 2023-03-04 11:03:13 -08:00
XOR-op
c494045673 WIP: logic of NameServer 2023-03-04 11:03:13 -08:00
Jeff Hiner
15423b8610 Use JoinSet for resolver tokio tasks 2022-09-13 08:46:56 -07:00
Benjamin Fry
5d22afd88d integrate quic into resolver (untested) 2022-04-07 13:23:18 -07:00
Benjamin Fry
b4bc3552bd Warn on default trait usage 2022-02-17 19:47:32 -08:00
Peter Johnston
aefb6deded Default to only switch to TCP if response was truncated
Currently, if queries to name servers over UDP result in either a
truncated response, or any kind of error, the query will be retried over
TCP. It should be possible to only use TCP for the case of oversized
messages, and avoid it in the common case. This change makes this the
default behavior and adds an option to ResolverOpts that can be enabled
to get the current behavior.
2021-10-08 09:46:55 -07:00
Benjamin Fry
402a14abce upgrade trust-dns-resolver to Tokio 0.3 2020-11-28 20:38:00 -08:00
Dirkjan Ochtman
94fa917c74 remove non-macro-use extern crate imports 2020-10-13 07:58:06 -07:00
Dirkjan Ochtman
89f786236a make dns-over-rustls optional for tools crate
This is so we get a consistent requirement for the availability of the
`tls_config` field in the `NameServerConfig` struct.

Preserves two constraints that seem important:

* Crates are compiled without TLS by default, matching the default features
* Using cargo with --all-features works correctly
2020-10-10 15:41:22 -07:00
Johnny Bergström
2502c58c14 use RuntimeProvider in https (#1077)
* logger: missing https crate

* https: use RuntimeProvider when making connections

- [X] use RuntimeProvider when making TCP connections
- [ ] use RuntimeProvider when making TLS upgrades
- [ ] migrate tests

* RuntimeProvider::Tcp: remove async read/write

The TCP needs to Connect, the async readwriter will be in the
transport of connect. Thus we don't need it to be a requirement
on the top trait of RuntimeProvider

* AsyncResolver: remove async from new()

Related to overriding RuntimeProvider for #1074

Solves #1056

* cleanup tests

* rebase master for 0.19.5

* fix windows tests

Co-authored-by: Benjamin Fry <benjaminfry@me.com>
2020-05-02 11:18:50 -07:00
Chunying Wang
e2abc67abf [trust-dns-resolver] Abstract resolver
1. Create a trait RuntimeProvider to abstract the resolver
implementation.
2. Make TokioAsyncResolver as default type.
3. Keep the tls related codes unchanged, which may be abstracted at a
later point.
4. Update the other codes and test cases wherever necessary.
2019-12-28 10:10:30 -08:00
Benjamin Fry
224bde6561 Background with generic spawn (#935)
* all tests updated for new background

* background in Resolver now supported, wip

* clean up client impls

* client passing all tests

* cleanup review comments, remove try_locks

* remove mutexes on NameServers in NameServerPool

* refactored ConnectionProvider

* remove pinutils dependency

* remove the now unused custom *LookupFutures

* remove unused types

* remove all deprecated interfaces from Client

* rename ClientFuture to AsyncClient

* all clippy warnings and SecureClient working

* cleanup clippy warnnings

* Everything working with Background removed

* fix infinite loop

* Client refactored without background

* rebased onto tokio 0.2

* remove Clone and Option from background connects

* cleanup from review

* fix clippy warnings

* spawn in ConnectionProvider

* fix no-default-features test

* only expose testing functions during testing

* fix copyright typo

* revert lookup_ip interface change

* limit tokio features to least required set

* rename tokio-compat to tokio-runtime

* use async fns where possible on AsyncResolver

* fix lifetime issue
2019-12-11 17:43:02 -08:00
Benjamin Fry
3eaf3043d7 update to tokio 0.2 release (#932)
* update to tokio 0.2 release

* update to h2 0.2.0

* fix compilation errors

* server await JoinHandles from spawn

* fix integration tests using different Runtimes

* cleanup named test output

* fix openssl tests

* cleanup code from review

* refactor server_future for JoinHandle, also fix Udp deadlock
2019-12-06 00:00:00 -08:00
ziprandom
8f3a0ebeb7 Allow for the rustls client to be passed to the resolver
Currently the trust-dns-resolver uses a hardcoded rustls::ClientConfig
when build with the dns-over-rustls feature. this makes it impossible
to change the accepted root certificates and other properties of the
tls client.

This commit adds a new field to the NameServerConfig to optionally
pass a rustls::ClientConfig which get's used instead. The webpki-roots
store is used as the default fallback so existing implementations
should work as before.

A new type TlsClientConfig was added as a wrapper for
rustls::ClientConfig which doesn't implement the Debug, Eq & PartialEq
traits. This might become obsolete if rustls can provide the trait
implementations one day.

The custom rustls:ClientConfig can be set vía a set_tls_client_config
method which is defined on trust-dns-resolver::NameServerConfigGroup
and trust-dns-resolver::ResolverConf.
2019-10-25 21:21:54 -07:00
Benjamin Fry
31fbf66316 reformat all code 2019-10-17 21:59:20 -07:00
Benjamin Fry
ee09ff92a2 all-features now compiling and passing tests 2019-10-17 21:59:20 -07:00
Benjamin Fry
4363bfd744 Clean up directory structure of crates (#589)
* Move all public crates into crates/

Integration tests into tests/

* move test certs into tests/test-data

* fix benches

* fix compatibility tests
2018-10-22 08:22:58 -07:00