mirror of
https://github.com/chatmail/relay.git
synced 2026-08-21 16:00:56 +00:00
feat(resolver): Enable DNSSEC (#94)
From hickory-resolver docs: > To enable DNSSEC, enable the dnssec-ring feature. Related: https://github.com/chatmail/relay/issues/877 Related: https://github.com/hickory-dns/hickory-dns/issues/3519 Closes: https://github.com/chatmail/filtermail/issues/93 Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
@@ -40,7 +40,17 @@ impl CachedResolver {
|
||||
/// Creates a new [`CachedResolver`].
|
||||
pub fn new() -> Result<Self, crate::error::Error> {
|
||||
// Use resolv.conf
|
||||
let dns_resolver = TokioResolver::builder(TokioConnectionProvider::default())?.build();
|
||||
let dns_resolver = {
|
||||
let mut builder = TokioResolver::builder(TokioConnectionProvider::default())?;
|
||||
// https://github.com/hickory-dns/hickory-dns/issues/3519
|
||||
builder.options_mut().validate = true;
|
||||
builder.build()
|
||||
};
|
||||
|
||||
assert!(
|
||||
dns_resolver.options().validate,
|
||||
"incorrect resolver config: DNSSEC disabled; exiting"
|
||||
);
|
||||
|
||||
let cache = Arc::new(parking_lot::Mutex::new(LruCache::new(LRU_CACHE_CAPACITY)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user