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 with client certificate to the loghost.
4# The server verifies the connection to its TLS socket and gets the message.
5# Find the message in client, file, pipe, syslogd, server log.
6# Check that syslogd has client cert and key in log.
7# Check that server has client certificate subject in log.
8
9use strict;
10use warnings;
11use Socket;
12
13our %args = (
14    syslogd => {
15	options => [qw(-c client.crt -k client.key)],
16	loghost => '@tls://localhost:$connectport',
17	loggrep => {
18	    qr/ClientCertfile client.crt/ => 1,
19	    qr/ClientKeyfile client.key/ => 1,
20	    get_testgrep() => 1,
21	},
22    },
23    server => {
24	listen => { domain => AF_UNSPEC, proto => "tls", addr => "localhost" },
25	sslca => "ca.crt",
26	loggrep => {
27	    qr/ssl subject: /.
28		qr{/L=OpenBSD/O=syslogd-regress/OU=client/CN=localhost} => 1,
29	    get_testgrep() => 1,
30	},
31    },
32);
33
341;
35