diff options
author | Eric Wong <e@80x24.org> | 2023-10-03 06:43:48 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-03 10:16:06 +0000 |
commit | 8fbb07b8ef6de3709b15790180975ce0282483ab (patch) | |
tree | 01cf8e8ade53898f432eb016fd5d333c7b753d45 /t/nntpd-tls.t | |
parent | d0a8dd236f768965aa9c034975412d526dab8a01 (diff) | |
download | public-inbox-8fbb07b8ef6de3709b15790180975ce0282483ab.tar.gz |
These options are useful for testing as well as users stuck on out-of-date systems, dealing with forgetful sysadmins, broken cronjobs, and/or are willing to risk MITM attacks.
Diffstat (limited to 't/nntpd-tls.t')
-rw-r--r-- | t/nntpd-tls.t | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/t/nntpd-tls.t b/t/nntpd-tls.t index 095aef96..21377fc0 100644 --- a/t/nntpd-tls.t +++ b/t/nntpd-tls.t @@ -1,8 +1,7 @@ #!perl -w -# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> -use strict; -use v5.10.1; +use v5.12; use PublicInbox::TestCommon; use Socket qw(SOCK_STREAM IPPROTO_TCP SOL_SOCKET); # IO::Poll and Net::NNTP are part of the standard library, but @@ -149,12 +148,22 @@ for my $args ( test_lei(sub { lei_ok qw(ls-mail-source), "nntp://$starttls_addr", \'STARTTLS not used by default'; + my $plain_out = $lei_out; ok(!lei(qw(ls-mail-source -c nntp.starttls), "nntp://$starttls_addr"), 'STARTTLS verify fails'); like $lei_err, qr/STARTTLS requested/, 'STARTTLS noted in stderr'; unlike $lei_err, qr!W: nntp\.starttls= .*? is not boolean!i, 'no non-boolean warning'; + lei_ok qw(-c nntp.starttls -c nntp.sslVerify= ls-mail-source), + "nntp://$starttls_addr", + \'disabling nntp.sslVerify works w/ STARTTLS'; + is $lei_out, $plain_out, 'sslVerify=false w/ STARTTLS output'; + + lei_ok qw(ls-mail-source -c nntp.sslVerify=false), + "nntps://$nntps_addr", + \'disabling nntp.sslVerify works w/ nntps://'; + is $lei_out, $plain_out, 'sslVerify=false w/ NNTPS output'; }); SKIP: { |