about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-19 12:50:32 +0000
committerEric Wong <e@80x24.org>2021-09-19 19:53:03 +0000
commit20c940a876728fe91892200dd874dd917cd677ac (patch)
tree7a33c0075d6bb11fe9f746cc3c6ff5b421bbf165 /t
parent207f0f93632e26818f2ed3b9d78bf3251b5a69b3 (diff)
downloadpublic-inbox-20c940a876728fe91892200dd874dd917cd677ac.tar.gz
At least not by default, to match existing NNTP behavior.
Tor .onions are already encrypted, and there's no point
in encrypting traffic on localhost outside of testing.
Diffstat (limited to 't')
-rw-r--r--t/imapd-tls.t11
-rw-r--r--t/nntpd-tls.t8
2 files changed, 17 insertions, 2 deletions
diff --git a/t/imapd-tls.t b/t/imapd-tls.t
index 72ba8769..73f5112f 100644
--- a/t/imapd-tls.t
+++ b/t/imapd-tls.t
@@ -1,8 +1,8 @@
+#!perl -w
 # Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
-use warnings;
-use Test::More;
+use v5.10.1;
 use Socket qw(IPPROTO_TCP SOL_SOCKET);
 use PublicInbox::TestCommon;
 # IO::Poll is part of the standard library, but distros may split it off...
@@ -155,6 +155,13 @@ for my $args (
         ok(sysread($slow, my $end, 4096) > 0, 'got end');
         is(sysread($slow, my $eof, 4096), 0, 'got EOF');
 
+        test_lei(sub {
+                lei_ok qw(ls-mail-source), "imap://$starttls_addr",
+                        \'STARTTLS not used by default';
+                ok(!lei(qw(ls-mail-source -c imap.starttls=true),
+                        "imap://$starttls_addr"), 'STARTTLS verify fails');
+        });
+
         SKIP: {
                 skip 'TCP_DEFER_ACCEPT is Linux-only', 2 if $^O ne 'linux';
                 my $var = eval { Socket::TCP_DEFER_ACCEPT() } // 9;
diff --git a/t/nntpd-tls.t b/t/nntpd-tls.t
index 2c09d34e..9af6c254 100644
--- a/t/nntpd-tls.t
+++ b/t/nntpd-tls.t
@@ -146,6 +146,14 @@ for my $args (
         is(sysread($slow, my $eof, 4096), 0, 'got EOF');
         $slow = undef;
 
+        test_lei(sub {
+                lei_ok qw(ls-mail-source), "nntp://$starttls_addr",
+                        \'STARTTLS not used by default';
+                ok(!lei(qw(ls-mail-source -c nntp.starttls=true),
+                        "nntp://$starttls_addr"), 'STARTTLS verify fails');
+                diag $lei_err;
+        });
+
         SKIP: {
                 skip 'TCP_DEFER_ACCEPT is Linux-only', 2 if $^O ne 'linux';
                 my $var = eval { Socket::TCP_DEFER_ACCEPT() } // 9;