xref: /openbsd-src/regress/usr.sbin/syslogd/args-tls-cipher-null.pl (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1# The client writes a message to Sys::Syslog native method.
2# The syslogd writes it into a file and through a pipe.
3# The syslogd passes it via TLS to localhost loghost.
4# The server offers only the null cipher on its TLS socket.
5# Find the message in client, file, pipe, syslogd log.
6# Check that server log contains the no shared cipher error.
7
8use strict;
9use warnings;
10use Socket;
11
12our %args = (
13    syslogd => {
14	loghost => '@tls://localhost:$connectport',
15	loggrep => {
16	    qr/Logging to FORWTLS \@tls:\/\/localhost:\d+/ => '>=4',
17	    qr/syslogd: loghost .* connection error: /.
18		qr/handshake failed: error.*:/.
19		qr/SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure/ => 2,
20	    get_testgrep() => 1,
21	},
22	cacrt => "ca.crt",
23    },
24    server => {
25	listen => { domain => AF_UNSPEC, proto => "tls", addr => "localhost" },
26	sslciphers => "NULL",
27	up => "IO::Socket::SSL socket accept failed",
28	down => "Server",
29	exit => 255,
30	loggrep => {
31	    qr/listen sock: (127.0.0.1|::1) \d+/ => 1,
32	    qr/no shared cipher/ => 1,
33	    get_testgrep() => 0,
34	},
35    },
36);
37
381;
39