| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # added 2019-11-13 by alorbach |
| 3 | . ${srcdir:=.}/diag.sh init |
| 4 | require_relpEngineSetTLSLibByName |
| 5 | export PORT_RCVR="$(get_free_port)" |
| 6 | export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction nostdout" |
| 7 | export RSYSLOG_DEBUGLOG="$RSYSLOG_DYNNAME.receiver.debuglog" |
| 8 | generate_conf |
| 9 | add_conf ' |
| 10 | module( load="../plugins/imrelp/.libs/imrelp" |
| 11 | tls.tlslib="openssl") |
| 12 | # then SENDER sends to this port (not tcpflood!) |
| 13 | input( type="imrelp" port="'$PORT_RCVR'" tls="on" |
| 14 | tls.tlscfgcmd="Protocol=ALL,-SSLv2,-SSLv3,-TLSv1,-TLSv1.2 |
| 15 | CipherString=ECDHE-RSA-AES256-GCM-SHA384 |
| 16 | Protocol=ALL,-SSLv2,-SSLv3,-TLSv1,-TLSv1.2,-TLSv1.3 |
| 17 | MinProtocol=TLSv1.2 |
| 18 | MaxProtocol=TLSv1.2" |
| 19 | ) |
| 20 | |
| 21 | $template outfmt,"%msg:F,58:2%\n" |
| 22 | :msg, contains, "msgnum:" action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt") |
| 23 | ' |
| 24 | startup |
| 25 | |
| 26 | export RSYSLOG_DEBUGLOG="$RSYSLOG_DYNNAME.sender.debuglog" |
| 27 | generate_conf 2 |
| 28 | add_conf ' |
| 29 | module( load="../plugins/omrelp/.libs/omrelp" |
| 30 | tls.tlslib="openssl") |
| 31 | |
| 32 | action( type="omrelp" target="127.0.0.1" port="'$PORT_RCVR'" tls="on" |
| 33 | tls.tlscfgcmd="Protocol=ALL,-SSLv2,-SSLv3,-TLSv1.1,-TLSv1.2 |
| 34 | CipherString=DHE-RSA-AES256-SHA |
| 35 | Protocol=ALL,-SSLv2,-SSLv3,-TLSv1.1,-TLSv1.2,-TLSv1.3 |
| 36 | MinProtocol=TLSv1.1 |
| 37 | MaxProtocol=TLSv1.1" ) |
| 38 | ' 2 |
| 39 | startup 2 |
| 40 | |
| 41 | # now inject the messages into instance 2. It will connect to instance 1, |
| 42 | # and that instance will record the data. |
| 43 | injectmsg2 1 1000 |
| 44 | |
| 45 | # shut down sender |
| 46 | shutdown_when_empty 2 |
| 47 | wait_shutdown 2 |
| 48 | # now it is time to stop the receiver as well |
| 49 | shutdown_when_empty |
| 50 | wait_shutdown |
| 51 | |
| 52 | content_check --check-only "relpTcpConnectTLSInit_gnutls" ${RSYSLOG_DEBUGLOG} |
| 53 | ret=$? |
| 54 | if [scip-shell system . . `[`. $ret == 0 ]; then |
| 55 | echoscip-shell system . . echo. "SKIP: LIBRELP was build without OPENSSL Support" |
| 56 | skip_test |
| 57 | fi |
| 58 | |
| 59 | content_check --check-only "OpenSSL Version too old" $RSYSLOG_DEBUGLOG |
| 60 | ret=$? |
| 61 | if [scip-shell system . . `[`. $ret == 0 ]; then |
| 62 | echoscip-shell system . . echo. "SKIP: OpenSSL Version too old" |
| 63 | skip_test |
| 64 | else |
| 65 | # Kindly check for a failed session |
| 66 | content_check "librelp: generic error: ecode 10031" $RSYSLOG_DEBUGLOG |
| 67 | # content_check "OpenSSL Error Stack:" |
| 68 | fi |
| 69 | |
| 70 | exit_test |