hickory-util 0.26.1

Utilities that complement Hickory DNS.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
// Copyright 2015-2022 Benjamin Fry <benjaminfry@me.com>
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// https://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// https://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.

//! The dns client program

use std::net::SocketAddr;
#[cfg(feature = "__tls")]
use std::sync::Arc;
#[cfg(feature = "__dnssec")]
use std::{fs::OpenOptions, io::Write, path::PathBuf};

use clap::{Args, Parser, Subcommand, ValueEnum};
#[cfg(feature = "__tls")]
use rustls::{
    ClientConfig, DigitallySignedStruct,
    client::danger::{HandshakeSignatureValid, ServerCertVerified},
    pki_types::{CertificateDer, ServerName, UnixTime},
};

#[cfg(feature = "__https")]
use hickory_net::h2::HttpsClientStream;
#[cfg(feature = "__h3")]
use hickory_net::h3::H3ClientStream;
#[cfg(feature = "__quic")]
use hickory_net::quic::QuicClientStream;
#[cfg(any(feature = "__tls", feature = "__https"))]
use hickory_net::tls::client_config;
#[cfg(feature = "__tls")]
use hickory_net::tls::tls_client_connect;
use hickory_net::{
    NetError,
    client::{Client, ClientHandle},
    runtime::{RuntimeProvider, TokioRuntimeProvider},
    tcp::TcpClientStream,
    udp::UdpClientStream,
};
#[cfg(feature = "__dnssec")]
use hickory_proto::{
    dnssec::{Algorithm, PublicKey, TrustAnchors, Verifier, rdata::DNSKEY},
    rr::Record,
};
use hickory_proto::{
    op::DnsResponse,
    rr::{DNSClass, Name, RData, RecordSet, RecordType},
};

/// A CLI interface for the hickory-client.
///
/// This utility directly uses the hickory-client to perform actions with a single
/// DNS server
#[derive(Debug, Parser)]
#[clap(name = "hickory dns client", version)]
struct Opts {
    /// Specify a nameserver to use, ip and port e.g. 8.8.8.8:53 or \[2001:4860:4860::8888\]:53 (port required)
    #[clap(short = 'n', long)]
    nameserver: SocketAddr,

    /// Protocol type to use for the communication
    #[clap(short = 'p', long, default_value = "udp", value_enum)]
    protocol: Protocol,

    /// TLS endpoint name, i.e. the name in the certificate presented by the remote server
    #[clap(short = 't', long, required_if_eq_any = [("protocol", "tls"), ("protocol", "https"), ("protocol", "quic")])]
    tls_dns_name: Option<String>,

    /// HTTP endpoint path. Relevant only to DNS-over-HTTPS. Defaults to `/dns-query`.
    #[clap(short = 'e', long, default_value = "/dns-query")]
    http_endpoint: Option<String>,

    /// For TLS, HTTPS, QUIC and H3 a custom ALPN code can be supplied
    ///
    /// Defaults: none for TLS (`dot` has been suggested), `h2` for HTTPS, `doq` for QUIC, and `h3` for H3
    #[clap(short = 'a',
        long,
        default_value_ifs = [("protocol", "tls", None), ("protocol", "https", Some("h2")), ("protocol", "quic", Some("doq")), ("protocol", "h3", Some("h3"))]
    )]
    alpn: Option<String>,

    // TODO: put this behind a feature gate
    /// DANGER: do not verify remote nameserver
    #[clap(long)]
    do_not_verify_nameserver_cert: bool,

    /// The Class of the record
    #[clap(long, default_value_t = DNSClass::IN)]
    class: DNSClass,

    /// Configure log verbosity.
    #[clap(flatten)]
    log_config: hickory_util::LogConfig,

    /// Command to execute
    #[clap(subcommand)]
    command: Command,
}

#[derive(Clone, Debug, ValueEnum)]
enum Protocol {
    Udp,
    Tcp,
    Tls,
    Https,
    Quic,
    H3,
}

#[derive(Debug, Subcommand)]
enum Command {
    Query(QueryOpt),
    Notify(NotifyOpt),
    Create(CreateOpt),
    Append(AppendOpt),
    // CompareAndSwap(),
    DeleteRecord(DeleteRecordOpt),
    // DeleteRecordSet,
    // DeleteAll,
    // ZoneTransfer,
    // Raw?
    #[cfg(feature = "__dnssec")]
    FetchKeys(FetchKeysOpt),
}

/// Query a name server for the record of the given type
#[derive(Debug, Args)]
struct QueryOpt {
    /// Name of the record to query
    name: Name,

    /// Type of DNS record to notify
    #[clap(name = "TYPE")]
    ty: RecordType,
}

impl QueryOpt {
    async fn run(
        self,
        class: DNSClass,
        mut client: impl ClientHandle,
    ) -> Result<DnsResponse, NetError> {
        let Self { name, ty } = self;
        println!("; sending query: {name} {class} {ty}");
        client.query(name, class, ty).await
    }
}

/// Notify a nameserver that a record has been updated
#[derive(Debug, Args)]

struct NotifyOpt {
    /// Name associated to the record that is being notified
    name: Name,

    /// Type of DNS record to notify
    #[clap(name = "TYPE")]
    ty: RecordType,

    /// Optional record data to associate
    rdata: Vec<String>,
}

impl NotifyOpt {
    async fn run(
        self,
        class: DNSClass,
        mut client: impl ClientHandle,
    ) -> Result<DnsResponse, NetError> {
        let Self { name, ty, rdata } = self;
        let rdata = if rdata.is_empty() {
            None
        } else {
            let ttl = 0;
            Some(record_set_from(name.clone(), class, ty, ttl, rdata))
        };

        println!("; sending notify: {name} {class} {ty}");
        client.notify(name, class, ty, rdata).await
    }
}

/// Create a new record in the target zone
#[derive(Debug, Args)]
struct CreateOpt {
    /// Name associated to the record to create
    name: Name,

    /// Type of DNS record to create
    #[clap(name = "TYPE")]
    ty: RecordType,

    /// Time to live value for the record
    ttl: u32,

    /// Zone, required for dynamic DNS updates, e.g. example.com if updating www.example.com
    #[clap(short = 'z', long)]
    zone: Name,

    /// Record data to associate
    #[clap(required = true)]
    rdata: Vec<String>,
}

impl CreateOpt {
    async fn run(
        self,
        class: DNSClass,
        mut client: impl ClientHandle,
    ) -> Result<DnsResponse, NetError> {
        let Self {
            name,
            ty,
            ttl,
            zone,
            rdata,
        } = self;
        let rdata = record_set_from(name.clone(), class, ty, ttl, rdata);

        println!("; sending create: {name} {class} {ty} in {zone}");
        client.create(rdata, zone).await
    }
}

/// Append record data to a record set
#[derive(Debug, Args)]
struct AppendOpt {
    /// If true, then the record must exist for the append to succeed
    #[clap(long)]
    must_exist: bool,

    /// Name associated to the record that is being updated
    name: Name,

    /// Type of DNS record to update
    #[clap(name = "TYPE")]
    ty: RecordType,

    /// Time to live value for the record
    ttl: u32,

    /// Zone, required for dynamic DNS updates, e.g. example.com if updating www.example.com
    #[clap(short = 'z', long)]
    zone: Name,

    /// Record data to associate
    #[clap(required = true)]
    rdata: Vec<String>,
}

impl AppendOpt {
    async fn run(
        self,
        class: DNSClass,
        mut client: impl ClientHandle,
    ) -> Result<DnsResponse, NetError> {
        let Self {
            must_exist,
            name,
            ty,
            ttl,
            zone,
            rdata,
        } = self;
        let rdata = record_set_from(name.clone(), class, ty, ttl, rdata);

        println!("; sending append: {name} {class} {ty} in {zone} and must_exist({must_exist})");
        client.append(rdata, zone, must_exist).await
    }
}

/// Delete a single record from a zone, the data must match the record
#[derive(Debug, Args)]
struct DeleteRecordOpt {
    /// Name associated to the record that is being updated
    name: Name,

    /// Type of DNS record to update
    #[clap(name = "TYPE")]
    ty: RecordType,

    /// Zone, required for dynamic DNS updates, e.g. example.com if updating www.example.com
    #[clap(short = 'z', long)]
    zone: Name,

    /// Record data to associate
    #[clap(required = true)]
    rdata: Vec<String>,
}

impl DeleteRecordOpt {
    async fn run(
        self,
        class: DNSClass,
        mut client: impl ClientHandle,
    ) -> Result<DnsResponse, NetError> {
        let Self {
            name,
            ty,
            zone,
            rdata,
        } = self;
        let ttl = 0;
        let rdata = record_set_from(name.clone(), class, ty, ttl, rdata);

        println!("; sending delete-record: {name} {class} {ty} from {zone}");
        client.delete_by_rdata(rdata, zone).await
    }
}

/// Fetch the dnskeys (key-signing-keys) from a zone, if zone is not specified it defaults to the Root, `.`
#[cfg(feature = "__dnssec")]
#[derive(Debug, Args)]
struct FetchKeysOpt {
    /// Zone, required for dynamic DNS updates, e.g. example.com if updating www.example.com
    #[clap(short = 'z', long)]
    zone: Name,

    /// If specified, files of Keys not in the Hickory TrustAnchor will be written to this path
    output_dir: Option<PathBuf>,
}

#[cfg(feature = "__dnssec")]
impl FetchKeysOpt {
    async fn run(
        self,
        class: DNSClass,
        mut client: impl ClientHandle,
    ) -> Result<(), Box<dyn std::error::Error>> {
        let Self { zone, output_dir } = self;

        println!("; querying {zone} for key-signing-dnskeys, KSKs");

        let record_type = RecordType::DNSKEY;
        let response = client.query(zone, class, record_type).await?;
        let response = response.into_message();

        println!("; received response");
        println!("{response}");

        let trust_anchor = TrustAnchors::default();

        for dnskey in response
            .answers
            .iter()
            .filter_map(Record::try_borrow::<DNSKEY>)
            .filter(|dnskey| dnskey.data().secure_entry_point() && dnskey.data().zone_key())
        {
            let key_tag = dnskey.data().calculate_key_tag().expect("key_tag failed");
            let algorithm = dnskey.data().algorithm();
            let in_trust_anchor = trust_anchor.contains(dnskey.data().public_key());

            if !dnskey.data().algorithm().is_supported() {
                println!(
                    "; ignoring {key_tag}, unsupported algorithm {algorithm}: {}",
                    dnskey.data()
                );

                continue;
            }

            println!(
                "; found dnskey: {key_tag}, {algorithm}, in Hickory TrustAnchor: {in_trust_anchor}",
            );
            let Some(path) = &output_dir else {
                continue;
            };

            // only write unknown files
            if in_trust_anchor {
                println!("; skipping key in TrustAnchor");
                continue;
            }

            #[allow(deprecated)]
            let extension = match dnskey.data().algorithm() {
                Algorithm::RSASHA1
                | Algorithm::RSASHA1NSEC3SHA1
                | Algorithm::RSASHA256
                | Algorithm::RSASHA512 => String::from("rsa"),
                Algorithm::ECDSAP256SHA256 | Algorithm::ECDSAP384SHA384 => String::from("ecdsa"),
                Algorithm::ED25519 => String::from("ed25519"),
                Algorithm::Unknown(v) => format!("unknown_{v}"),
                alg => panic!("unknown Algorithm {alg:?}"),
            };

            let mut path = path.clone();
            path.push(format!("{key_tag}"));
            path.set_extension(extension);

            let mut file = OpenOptions::new();
            let mut file = file
                .write(true)
                .read(false)
                .truncate(true)
                .create(true)
                .open(&path)
                .expect("couldn't open file for writing");

            file.write_all(dnskey.data().public_key().public_bytes())
                .expect("failed to write to file");
            println!("; wrote dnskey {key_tag} to: {}", path.display());
        }

        Ok(())
    }
}

/// Run the resolve program
#[tokio::main]
pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let opts: Opts = Opts::parse();

    // enable logging early
    hickory_util::logger(env!("CARGO_BIN_NAME"), opts.log_config.level());

    // TODO: need to cleanup all of ClientHandle and the Client in general to make it dynamically usable.
    let provider = TokioRuntimeProvider::new();
    match opts.protocol {
        Protocol::Udp => udp(opts, provider).await?,
        Protocol::Tcp => tcp(opts, provider).await?,
        Protocol::Tls => tls(opts, provider).await?,
        Protocol::Https => https(opts, provider).await?,
        Protocol::Quic => quic(opts).await?,
        Protocol::H3 => h3(opts).await?,
    };

    Ok(())
}

async fn udp<P: RuntimeProvider>(
    opts: Opts,
    provider: P,
) -> Result<(), Box<dyn std::error::Error>> {
    let nameserver = opts.nameserver;

    println!("; using udp:{nameserver}");
    let stream = UdpClientStream::builder(nameserver, provider).build();
    let (client, bg) = Client::<P>::from_sender(stream);
    let handle = tokio::spawn(bg);
    handle_request(opts.class, opts.command, client).await?;
    drop(handle);

    Ok(())
}

async fn tcp<P: RuntimeProvider>(
    opts: Opts,
    provider: P,
) -> Result<(), Box<dyn std::error::Error>> {
    let nameserver = opts.nameserver;

    println!("; using tcp:{nameserver}");
    let (future, sender) = TcpClientStream::new(nameserver, None, None, provider);
    let (client, bg) = Client::<P>::new(future.await?, sender);

    let handle = tokio::spawn(bg);
    handle_request(opts.class, opts.command, client).await?;
    drop(handle);

    Ok(())
}

#[cfg(not(feature = "__tls"))]
async fn tls(
    _opts: Opts,
    _provider: impl RuntimeProvider,
) -> Result<(), Box<dyn std::error::Error>> {
    panic!("`tls-aws-lc-rs` or `tls-ring` feature is required during compilation");
}

#[cfg(feature = "__tls")]
async fn tls<P: RuntimeProvider>(
    opts: Opts,
    provider: P,
) -> Result<(), Box<dyn std::error::Error>> {
    let nameserver = opts.nameserver;
    let alpn = opts.alpn.map(String::into_bytes);
    let dns_name = opts
        .tls_dns_name
        .expect("tls_dns_name is required tls connections");
    println!("; using tls:{nameserver} dns_name:{dns_name}");

    let mut config = client_config()?;
    if opts.do_not_verify_nameserver_cert {
        do_not_verify_nameserver_cert(&mut config);
    }
    if let Some(alpn) = alpn {
        config.alpn_protocols.push(alpn);
    }

    let config = Arc::new(config);
    let server_name =
        ServerName::try_from(dns_name).expect("failed to parse tls_dns_name as ServerName");
    let (future, sender) = tls_client_connect(nameserver, server_name, config, provider);
    let (client, bg) = Client::<P>::new(future.await?, sender);

    let handle = tokio::spawn(bg);
    handle_request(opts.class, opts.command, client).await?;
    drop(handle);

    Ok(())
}

#[cfg(not(feature = "__https"))]
async fn https(
    _opts: Opts,
    _provider: impl RuntimeProvider,
) -> Result<(), Box<dyn std::error::Error>> {
    panic!("`https-aws-lc-rs` or `https-ring` feature is required during compilation");
}

#[cfg(feature = "__https")]
async fn https<P: RuntimeProvider>(
    opts: Opts,
    provider: P,
) -> Result<(), Box<dyn std::error::Error>> {
    let nameserver = opts.nameserver;
    let alpn = opts
        .alpn
        .map(String::into_bytes)
        .expect("ALPN is required for HTTPS");
    let dns_name = opts
        .tls_dns_name
        .expect("tls_dns_name is required for https connections");
    let http_endpoint = opts
        .http_endpoint
        .expect("http_endpoint is required for https connections");
    println!("; using https:{nameserver} dns_name:{dns_name}");

    let mut config = client_config()?;
    if opts.do_not_verify_nameserver_cert {
        do_not_verify_nameserver_cert(&mut config);
    }
    config.alpn_protocols.push(alpn);
    let config = Arc::new(config);

    let sender = HttpsClientStream::builder(config, provider)
        .build(nameserver, Arc::from(dns_name), Arc::from(http_endpoint))
        .await?;
    let (client, bg) = Client::<P>::from_sender(sender);
    let handle = tokio::spawn(bg);

    handle_request(opts.class, opts.command, client).await?;
    drop(handle);

    Ok(())
}

#[cfg(not(feature = "__quic"))]
async fn quic(_opts: Opts) -> Result<(), Box<dyn std::error::Error>> {
    panic!("`quic-aws-lc-rs` or `quic-ring` feature is required during compilation");
}

#[cfg(feature = "__quic")]
async fn quic(opts: Opts) -> Result<(), Box<dyn std::error::Error>> {
    let nameserver = opts.nameserver;
    let alpn = opts
        .alpn
        .map(String::into_bytes)
        .expect("ALPN is required for QUIC");
    let dns_name = opts
        .tls_dns_name
        .expect("tls_dns_name is required quic connections");
    println!("; using quic:{nameserver} dns_name:{dns_name}");

    let mut config = client_config()?;
    if opts.do_not_verify_nameserver_cert {
        do_not_verify_nameserver_cert(&mut config);
    }
    config.alpn_protocols.push(alpn);

    let sender = QuicClientStream::builder()
        .crypto_config(config)
        .build(nameserver, Arc::from(dns_name))
        .await?;
    let (client, bg) = Client::<TokioRuntimeProvider>::from_sender(sender);
    let handle = tokio::spawn(bg);

    handle_request(opts.class, opts.command, client).await?;
    drop(handle);

    Ok(())
}

#[cfg(not(feature = "__h3"))]
async fn h3(_opts: Opts) -> Result<(), Box<dyn std::error::Error>> {
    panic!("`h3-aws-lc-rs` or `h3-ring` feature is required during compilation");
}

#[cfg(feature = "__h3")]
async fn h3(opts: Opts) -> Result<(), Box<dyn std::error::Error>> {
    let nameserver = opts.nameserver;
    let alpn = opts
        .alpn
        .map(String::into_bytes)
        .expect("ALPN is required for H3");
    let dns_name = opts
        .tls_dns_name
        .expect("tls_dns_name is required for H3 connections");
    let http_endpoint = opts
        .http_endpoint
        .expect("http_endpoint is required for H3 connections");
    println!("; using h3:{nameserver} dns_name:{dns_name}");

    let mut config = client_config()?;
    if opts.do_not_verify_nameserver_cert {
        do_not_verify_nameserver_cert(&mut config);
    }
    config.alpn_protocols.push(alpn);

    let sender = H3ClientStream::builder()
        .crypto_config(config)
        .build(nameserver, Arc::from(dns_name), Arc::from(http_endpoint))
        .await?;
    let (client, bg) = Client::<TokioRuntimeProvider>::from_sender(sender);
    let handle = tokio::spawn(bg);

    handle_request(opts.class, opts.command, client).await?;
    drop(handle);

    Ok(())
}

async fn handle_request(
    class: DNSClass,
    command: Command,
    client: impl ClientHandle,
) -> Result<(), Box<dyn std::error::Error>> {
    let response = match command {
        Command::Query(opt) => opt.run(class, client).await?,
        Command::Notify(opt) => opt.run(class, client).await?,
        Command::Create(opt) => opt.run(class, client).await?,
        Command::Append(opt) => opt.run(class, client).await?,
        Command::DeleteRecord(opt) => opt.run(class, client).await?,
        #[cfg(feature = "__dnssec")]
        Command::FetchKeys(opt) => {
            opt.run(class, client).await?;
            return Ok(());
        }
    };

    let response = response.into_message();
    println!("; received response");
    println!("{response}");
    Ok(())
}

fn record_set_from(
    name: Name,
    class: DNSClass,
    record_type: RecordType,
    ttl: u32,
    rdata: Vec<String>,
) -> RecordSet {
    let rdata = rdata
        .iter()
        .map(|r| RData::try_from_str(record_type, r).expect("failed to parse rdata"));

    let mut record_set = RecordSet::with_ttl(name, record_type, ttl);
    record_set.set_dns_class(class);

    for data in rdata {
        record_set.add_rdata(data);
    }

    record_set
}

#[cfg(feature = "__tls")]
fn do_not_verify_nameserver_cert(tls_config: &mut ClientConfig) {
    let provider = tls_config.crypto_provider().clone();
    tls_config
        .dangerous()
        .set_certificate_verifier(Arc::new(DangerousVerifier { provider }));
}

#[cfg(feature = "__tls")]
#[derive(Debug)]
struct DangerousVerifier {
    provider: Arc<rustls::crypto::CryptoProvider>,
}

#[cfg(feature = "__tls")]
impl rustls::client::danger::ServerCertVerifier for DangerousVerifier {
    fn verify_server_cert(
        &self,
        _end_entity: &CertificateDer<'_>,
        _intermediates: &[CertificateDer<'_>],
        _server_name: &ServerName<'_>,
        _ocsp_response: &[u8],
        _now: UnixTime,
    ) -> Result<ServerCertVerified, rustls::Error> {
        println!(";!!!NOT VERIFYING THE SERVER TLS CERTIFICATE!!!");
        Ok(ServerCertVerified::assertion())
    }

    fn verify_tls12_signature(
        &self,
        _message: &[u8],
        _cert: &CertificateDer<'_>,
        _dss: &DigitallySignedStruct,
    ) -> Result<HandshakeSignatureValid, rustls::Error> {
        println!(";!!!NOT VERIFYING THE SERVER TLS CERTIFICATE!!!");
        Ok(HandshakeSignatureValid::assertion())
    }

    fn verify_tls13_signature(
        &self,
        _message: &[u8],
        _cert: &CertificateDer<'_>,
        _dss: &DigitallySignedStruct,
    ) -> Result<HandshakeSignatureValid, rustls::Error> {
        println!(";!!!NOT VERIFYING THE SERVER TLS CERTIFICATE!!!");
        Ok(HandshakeSignatureValid::assertion())
    }

    fn supported_verify_schemes(&self) -> Vec<rustls::SignatureScheme> {
        self.provider
            .signature_verification_algorithms
            .supported_schemes()
    }
}