blob: 6148a9dee6d22b1f76d3b249def54eabb291e1c3 [file] [log] [blame]
Remi Tricot-Le Bretond12e13a2021-10-11 15:34:14 +02001#REGTEST_TYPE=devel
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +02002
3# This reg-test checks that the connection and SSL sample fetches related to
4# errors are functioning properly. It also tests the proper behaviour of the
Remi Tricot-Le Breton1ac65f82021-10-11 15:34:11 +02005# default HTTPS log format and of the error-log-format option which allows to
6# define a specific log format used only in case of connection error (otherwise
7# a line following the configured log-format is output).
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +02008#
9# It works by sending request through three different paths, one using a custom
10# log-format line that contains the connection error and SSL handshake error
11# sample fetches, one using the default HTTPS log-format and one using the
12# legacy error log format.
13#
14# The output log lines are caught by syslog blocks (one for each path) and
15# compared to an expected format.
16# Since the syslog is not by design synchronized with the Varnish clients and
17# servers, synchronization is achieved through barriers, which ensure that
18# syslog messages arrive in the right order.
19#
Remi Tricot-Le Breton1ac65f82021-10-11 15:34:11 +020020# In order to ensure that the log line raised in case of connection error if an
21# error-log-format is defined still follows the log-separate-error option, the
22# log lines raised by the https_fmt_lst listener will be sent to two separate
23# syslog servers.
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020024#
25
26varnishtest "Test the connection and SSL error fetches."
27feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.5-dev2)'"
Remi Tricot-Le Bretond12e13a2021-10-11 15:34:14 +020028feature cmd "$HAPROXY_PROGRAM -cc 'feature(OPENSSL) && ssllib_name_startswith(OpenSSL)'"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020029feature cmd "command -v socat"
30feature ignore_unknown_macro
31
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +020032server s1 -repeat 4 {
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020033 rxreq
34 txresp
35} -start
36
37barrier b1 cond 4 -cyclic
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +020038barrier b2 cond 2 -cyclic
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020039
40
41syslog Slg_cust_fmt -level info {
42 recv
Remi Tricot-Le Breton74f6ab62021-08-19 18:06:30 +020043 expect ~ ".*conn_status:\"0:Success\" hsk_err:\"0:-\" CN=\"/C=FR/O=HAProxy Technologies/CN=Client\",serial=1007,hash=063DCC2E6A9159E66994B325D6D2EF3D17A75B6F"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020044
45 barrier b1 sync
46
47 recv
Remi Tricot-Le Bretond266cda2021-10-11 15:34:13 +020048 expect ~ "ERROR.*conn_status:\"30:SSL client CA chain cannot be verified\" hsk_err:\"134:.*:certificate verify failed\" CN=\"/C=FR/O=HAProxy Technologies/CN=Client\",serial=1007,hash=063DCC2E6A9159E66994B325D6D2EF3D17A75B6F"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020049
50 barrier b1 sync
51
52 recv
Remi Tricot-Le Bretond266cda2021-10-11 15:34:13 +020053 expect ~ "ERROR.*conn_status:\"31:SSL client certificate not trusted\" hsk_err:\"134:.*:certificate verify failed\" CN=\"/C=FR/O=HAProxy Technologies/CN=Client\",serial=1007,hash=063DCC2E6A9159E66994B325D6D2EF3D17A75B6F"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020054
55 barrier b1 sync
56
Ilya Shipitsinbd6b4be2021-10-15 16:18:21 +050057 # In case of an error occurring before the certificate verification process,
Remi Tricot-Le Breton74f6ab62021-08-19 18:06:30 +020058 # the client certificate chain is never parsed and verified so we can't
59 # have information about the client's certificate.
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020060 recv
Remi Tricot-Le Bretond266cda2021-10-11 15:34:13 +020061 expect ~ "ERROR.*conn_status:\"34:SSL handshake failure\" hsk_err:\"193:.*:no shared cipher\" CN=\"\",serial=-,hash=-"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020062} -start
63
64syslog Slg_https_fmt -level info {
65 recv
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +010066 expect ~ ".*https_logfmt_ssl_lst~ https_logfmt_ssl_lst/s1.*0/0000000000000000/0/0/.? foo.com/TLSv1.2/AES256-GCM-SHA384"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020067
68 barrier b1 sync
69} -start
70
71syslog Slg_https_fmt_err -level info {
72 recv
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +010073 expect ~ "ERROR.*https_logfmt_ssl_lst~ https_logfmt_ssl_lst/<NOSRV>.*30/0000000000000086/0/2/.? foo.com/TLSv1.2/\\(NONE\\)"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020074
75 barrier b1 sync
76
77 recv
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +010078 expect ~ "ERROR.*https_logfmt_ssl_lst~ https_logfmt_ssl_lst/<NOSRV>.*31/0000000000000086/20/0/.? foo.com/TLSv1.2/\\(NONE\\)"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020079
80 barrier b1 sync
81
82 recv
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +010083 expect ~ "ERROR.*https_logfmt_ssl_lst~ https_logfmt_ssl_lst/<NOSRV>.*34/00000000000000C1/0/0/.? foo.com/TLSv1.2/\\(NONE\\)"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +020084} -start
85
86syslog Slg_logconnerror -level info {
87 recv
88 expect ~ ".*logconnerror_ssl_lst~ logconnerror_ssl_lst/s1"
89
90 barrier b1 sync
91
92 recv
93 expect ~ ".*logconnerror_ssl_lst/1: SSL client CA chain cannot be verified"
94
95 barrier b1 sync
96
97 recv
98 expect ~ ".*logconnerror_ssl_lst/1: SSL client certificate not trusted"
99
100 barrier b1 sync
101
102 recv
103 expect ~ ".*logconnerror_ssl_lst/1: SSL handshake failure"
104} -start
105
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200106syslog Slg_bcknd -level info {
107 recv
Willy Tarreau6f749762021-11-05 17:07:03 +0100108 expect ~ ".*bc_err:0:\"Success\" ssl_bc_err:0:"
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200109
110 barrier b2 sync
111
112 recv
Willy Tarreau6f749762021-11-05 17:07:03 +0100113 expect ~ ".*bc_err:34:\"SSL handshake failure\" ssl_bc_err:134:.*:certificate verify failed"
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200114
115 barrier b2 sync
116
117 recv
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100118 expect ~ ".*bc_err:33:\"Server presented an SSL certificate different from the expected one\" ssl_bc_err:134:.*:certificate verify failed"
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200119
120 barrier b2 sync
121
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200122 # Verify errors on the server side cannot be caught when using TLSv1.3 but it works for TLSv1.2
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200123 recv
Willy Tarreau6f749762021-11-05 17:07:03 +0100124 expect ~ ".*bc_err:34:\"SSL handshake failure\" ssl_bc_err:1048:.*:tlsv1 alert unknown ca"
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200125
126 barrier b2 sync
127
128 recv
Willy Tarreau6f749762021-11-05 17:07:03 +0100129 expect ~ ".*bc_err:34:\"SSL handshake failure\" ssl_bc_err:1040:.*:sslv3 alert handshake failure"
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200130
131 barrier b2 sync
132
133 recv
Willy Tarreau6f749762021-11-05 17:07:03 +0100134 expect ~ ".*bc_err:34:\"SSL handshake failure\" ssl_bc_err:1040:.*:sslv3 alert handshake failure"
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200135} -start
136
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100137syslog Slg_bcknd_fe -level info {
138 # Client c13 - No error
139 recv
140 expect ~ ".* Server/TLSv1.3/TLS_AES_256_GCM_SHA384"
141
142 # Client c14 - Server certificate rejected
143 recv
144 expect ~ ".* foo.com/TLSv1.3/TLS_AES_256_GCM_SHA384"
145
146 # Client c15 - Server certificate mismatch (verifyhost option on backend)
147 recv
148 expect ~ ".* foo.com/TLSv1.3/TLS_AES_256_GCM_SHA384"
149
150 # Client c16 - Client certificate rejected
151 recv
152 expect ~ ".* foo.com/TLSv1.2/\\(NONE\\)"
153
154 # Client c17 - Wrong ciphers TLSv1.2
155 recv
156 expect ~ ".* foo.com/TLSv1.2/\\(NONE\\)"
157
158 # Client c18 - Wrong ciphers TLSv1.3 - the client does not get to send its certificate because the error happens before
159 recv
160 expect ~ ".* -/TLSv1.3/\\(NONE\\)"
161} -start
162
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200163
164haproxy h1 -conf {
165 global
166 tune.ssl.default-dh-param 2048
Marcin Deranek310a2602021-07-13 19:04:24 +0200167 tune.ssl.capture-buffer-size 1
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200168 stats socket "${tmpdir}/h1/stats" level admin
Remi Tricot-Le Bretond266cda2021-10-11 15:34:13 +0200169 .if openssl_version_atleast(3.0.0)
170 set-var proc.ssl_error_mask str(7FFFFF),hex2i
171 .else
172 set-var proc.ssl_error_mask str(FFF),hex2i
173 .endif
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200174
175 defaults
Willy Tarreauf6739232021-11-18 17:46:22 +0100176 timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
177 timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
178 timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200179 retries 0
180
181 listen clear_lst
182 bind "fd@${clearlst}"
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100183 default-server ssl crt ${testdir}/set_cafile_client.pem ca-file ${testdir}/set_cafile_interCA2.crt verify none no-ssl-reuse force-tlsv12 sni str(foo.com)
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200184
185 balance roundrobin
186 server cust_fmt "${tmpdir}/cust_logfmt_ssl.sock"
187 server https_fmt "${tmpdir}/https_logfmt_ssl.sock"
188 server logconnerror "${tmpdir}/logconnerror_ssl.sock"
189
190
191 listen clear_wrong_ciphers_lst
192 bind "fd@${wrongcipherslst}"
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100193 default-server ssl crt ${testdir}/set_cafile_client.pem ca-file ${testdir}/set_cafile_interCA2.crt verify none no-ssl-reuse force-tlsv12 ciphers "aECDSA" sni str(foo.com)
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200194
195 balance roundrobin
196 server cust_fmt "${tmpdir}/cust_logfmt_ssl.sock"
197 server https_fmt "${tmpdir}/https_logfmt_ssl.sock"
198 server logconnerror "${tmpdir}/logconnerror_ssl.sock"
199
200
Willy Tarreau6f749762021-11-05 17:07:03 +0100201 # This listener will be used to test backend fetches (bc_err and ssl_bc_err)
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200202 listen clear_backend_errors_lst
203 bind "fd@${backenderrorslst}"
204 log ${Slg_bcknd_addr}:${Slg_bcknd_port} local0
Willy Tarreau6f749762021-11-05 17:07:03 +0100205 log-format "bc_err:%[bc_err]:%{+Q}[bc_err_str]\ ssl_bc_err:%[ssl_bc_err,and(proc.ssl_error_mask)]:%{+Q}[ssl_bc_err_str]"
206 error-log-format "ERROR bc_err:%[bc_err]:%{+Q}[bc_err_str]\ ssl_bc_err:%[ssl_bc_err,and(proc.ssl_error_mask)]:%[ssl_bc_err_str]"
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200207
208 balance roundrobin
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100209 server no_err "${tmpdir}/no_err_ssl.sock" ssl crt ${testdir}/set_cafile_client.pem ca-file ${testdir}/set_cafile_interCA2.crt verify required sni str(Server)
210 server srv_cert_rejected "${tmpdir}/srv_rejected_ssl.sock" ssl crt ${testdir}/set_cafile_client.pem ca-file ${testdir}/set_cafile_interCA1.crt verify required sni str(foo.com)
211 server mismatch_frontend "${tmpdir}/mismatch_fe_ssl.sock" ssl crt ${testdir}/set_cafile_client.pem ca-file ${testdir}/set_cafile_interCA2.crt verify required sni str(foo.com) verifyhost str(toto) # We force TLSv1.2 for this specific case because server-side
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200212 # verification errors cannot be caught by the backend fetches when
213 # using TLSv1.3
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100214 server clt_cert_rejected "${tmpdir}/rejected_ssl.sock" ssl crt ${testdir}/set_cafile_client.pem ca-file ${testdir}/set_cafile_interCA2.crt verify none force-tlsv12 sni str(foo.com)
215 server wrong_ciphers "${tmpdir}/wrong_ciphers_ssl.sock" ssl verify none crt ${testdir}/client1.pem ca-file ${testdir}/ca-auth.crt force-tlsv12 ciphers "aECDSA" sni str(foo.com)
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200216
217 # No TLSv1.3 support with OpenSSL 1.0.2 so we duplicate the previous
218 # wrong cipher test in this case so that the error log remains the same
219.if openssl_version_before(1.1.1)
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100220 server wrong_ciphers2 "${tmpdir}/wrong_ciphers_ssl.sock" ssl verify none crt ${testdir}/client1.pem ca-file ${testdir}/ca-auth.crt force-tlsv12 ciphers "aECDSA" sni str(foo.com)
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200221.else
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100222 server wrong_ciphers_tls13 "${tmpdir}/wrong_ciphers_tls13_ssl.sock" ssl verify none crt ${testdir}/client1.pem ca-file ${testdir}/ca-auth.crt ciphersuites "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256" force-tlsv13 sni str(foo.com)
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200223.endif
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200224
225
226
227
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200228 listen cust_logfmt_ssl_lst
229 log ${Slg_cust_fmt_addr}:${Slg_cust_fmt_port} local0
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200230 mode http
Willy Tarreau6f749762021-11-05 17:07:03 +0100231 log-format "conn_status:\"%[fc_err]:%[fc_err_str]\" hsk_err:\"%[ssl_fc_err]:%[ssl_fc_err_str]\" CN=%{+Q}[ssl_c_s_dn],serial=%[ssl_c_serial,hex],hash=%[ssl_c_sha1,hex]"
232 error-log-format "ERROR conn_status:\"%[fc_err]:%[fc_err_str]\" hsk_err:\"%[ssl_fc_err,and(proc.ssl_error_mask)]:%[ssl_fc_err_str]\" CN=%{+Q}[ssl_c_s_dn],serial=%[ssl_c_serial,hex],hash=%[ssl_c_sha1,hex]"
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200233 bind "${tmpdir}/cust_logfmt_ssl.sock" ssl crt ${testdir}/set_cafile_server.pem ca-verify-file ${testdir}/set_cafile_rootCA.crt ca-file ${testdir}/set_cafile_interCA1.crt verify required ciphers "kRSA"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200234 server s1 ${s1_addr}:${s1_port}
235
236 listen https_logfmt_ssl_lst
237 log ${Slg_https_fmt_addr}:${Slg_https_fmt_port} local0 info
238 log ${Slg_https_fmt_err_addr}:${Slg_https_fmt_err_port} local0 err info
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200239 option log-separate-errors
240 mode http
241 option httpslog
Willy Tarreau68574dd2021-11-05 19:14:55 +0100242 error-log-format "ERROR %ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %[fc_err]/%[ssl_fc_err,and(proc.ssl_error_mask),hex]/%[ssl_c_err]/%[ssl_c_ca_err]/%[ssl_fc_is_resumed] %[ssl_fc_sni]/%sslv/%sslc"
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200243 bind "${tmpdir}/https_logfmt_ssl.sock" ssl crt ${testdir}/set_cafile_server.pem ca-verify-file ${testdir}/set_cafile_rootCA.crt ca-file ${testdir}/set_cafile_interCA1.crt verify required ciphers "kRSA"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200244 server s1 ${s1_addr}:${s1_port}
245
246 listen logconnerror_ssl_lst
247 log ${Slg_logconnerror_addr}:${Slg_logconnerror_port} local0 info
248 mode http
249 option httplog
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200250 bind "${tmpdir}/logconnerror_ssl.sock" ssl crt ${testdir}/set_cafile_server.pem ca-verify-file ${testdir}/set_cafile_rootCA.crt ca-file ${testdir}/set_cafile_interCA1.crt verify required ciphers "kRSA"
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200251 server s1 ${s1_addr}:${s1_port}
252
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200253
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100254
255 defaults bknd_err_dflt
256 timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
257 timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
258 timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
259 retries 0
260 log ${Slg_bcknd_fe_addr}:${Slg_bcknd_fe_port} local0
261 log-format "%ci:%cp %[ssl_fc_sni]/%sslv/%sslc"
262 error-log-format "ERROR %ci:%cp %[ssl_fc_sni]/%sslv/%sslc"
263
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200264 # The following listeners allow to test backend error fetches
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100265 listen no_backend_err_ssl_lst from bknd_err_dflt
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200266 bind "${tmpdir}/no_err_ssl.sock" ssl crt ${testdir}/set_cafile_server.pem ca-file ${testdir}/set_cafile_interCA2.crt verify none
267 server s1 ${s1_addr}:${s1_port}
268
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100269 listen srv_rejected_ssl_lst from bknd_err_dflt
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200270 bind "${tmpdir}/srv_rejected_ssl.sock" ssl crt ${testdir}/set_cafile_server.pem ca-file ${testdir}/set_cafile_interCA2.crt verify none
271 server s1 ${s1_addr}:${s1_port}
272
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100273 listen mismatch_fe_ssl_lst from bknd_err_dflt
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200274 bind "${tmpdir}/mismatch_fe_ssl.sock" ssl crt ${testdir}/set_cafile_server.pem ca-file ${testdir}/set_cafile_interCA2.crt verify none
275 server s1 ${s1_addr}:${s1_port}
276
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100277 listen rejected_clt_ssl_lst from bknd_err_dflt
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200278 bind "${tmpdir}/rejected_ssl.sock" ssl crt ${testdir}/set_cafile_server.pem ca-file ${testdir}/set_cafile_interCA2.crt verify required
279 server s1 ${s1_addr}:${s1_port}
280
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100281 listen wrong_ciphers_ssl_lst from bknd_err_dflt
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200282 bind "${tmpdir}/wrong_ciphers_ssl.sock" ssl crt ${testdir}/common.pem ca-file ${testdir}/ca-auth.crt verify none force-tlsv12 ciphers "kRSA"
283 server s1 ${s1_addr}:${s1_port}
284
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200285.if openssl_version_atleast(1.1.1)
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100286 listen wrong_ciphers_tls13_ssl_lst from bknd_err_dflt
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200287 bind "${tmpdir}/wrong_ciphers_tls13_ssl.sock" ssl crt ${testdir}/common.pem ca-file ${testdir}/ca-auth.crt verify none force-tlsv13 ciphersuites "TLS_AES_128_GCM_SHA256"
288 server s1 ${s1_addr}:${s1_port}
Remi Tricot-Le Bretone1b61092021-10-13 11:21:02 +0200289.endif
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200290
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200291} -start
292
293
294# The three following requests should all succeed
295client c1 -connect ${h1_clearlst_sock} {
296 txreq
297 rxresp
298 expect resp.status == 200
299} -run
300
301client c2 -connect ${h1_clearlst_sock} {
302 txreq
303 rxresp
304 expect resp.status == 200
305} -run
306
307client c3 -connect ${h1_clearlst_sock} {
308 txreq
309 rxresp
310 expect resp.status == 200
311} -run
312
313
314barrier b1 sync
315
316
317# Change the root CA in the frontends
318shell {
319 printf "set ssl ca-file ${testdir}/set_cafile_rootCA.crt <<\n$(cat ${testdir}/set_cafile_interCA1.crt)\n\n" | socat "${tmpdir}/h1/stats" -
320 echo "commit ssl ca-file ${testdir}/set_cafile_rootCA.crt" | socat "${tmpdir}/h1/stats" -
321}
322
323client c4 -connect ${h1_clearlst_sock} {
324 txreq
325} -run
326
327client c5 -connect ${h1_clearlst_sock} {
328 txreq
329} -run
330
331client c6 -connect ${h1_clearlst_sock} {
332 txreq
333} -run
334
335barrier b1 sync
336
337
338
339# Restore the root CA
340shell {
341 printf "set ssl ca-file ${testdir}/set_cafile_rootCA.crt <<\n$(cat ${testdir}/set_cafile_rootCA.crt)\n\n" | socat "${tmpdir}/h1/stats" -
342 echo "commit ssl ca-file ${testdir}/set_cafile_rootCA.crt" | socat "${tmpdir}/h1/stats" -
343}
344
345# Change the intermediate CA in the frontends
346shell {
347 printf "set ssl ca-file ${testdir}/set_cafile_interCA1.crt <<\n$(cat ${testdir}/set_cafile_interCA2.crt)\n\n" | socat "${tmpdir}/h1/stats" -
348 echo "commit ssl ca-file ${testdir}/set_cafile_interCA1.crt" | socat "${tmpdir}/h1/stats" -
349}
350
351client c7 -connect ${h1_clearlst_sock} {
352 txreq
353} -run
354
355client c8 -connect ${h1_clearlst_sock} {
356 txreq
357} -run
358
359client c9 -connect ${h1_clearlst_sock} {
360 txreq
361} -run
362
363barrier b1 sync
364
365
366# Restore the intermediate CA in the frontends
367shell {
368 printf "set ssl ca-file ${testdir}/set_cafile_interCA1.crt <<\n$(cat ${testdir}/set_cafile_interCA1.crt)\n\n" | socat "${tmpdir}/h1/stats" -
369 echo "commit ssl ca-file ${testdir}/set_cafile_interCA1.crt" | socat "${tmpdir}/h1/stats" -
370}
371
372# "No shared cipher" errors
373client c10 -connect ${h1_wrongcipherslst_sock} {
374 txreq
375} -run
376client c11 -connect ${h1_wrongcipherslst_sock} {
377 txreq
378} -run
379client c12 -connect ${h1_wrongcipherslst_sock} {
380 txreq
381} -run
382
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200383
384shell {
385 printf "set ssl ca-file ${testdir}/set_cafile_interCA2.crt <<\n$(cat ${testdir}/set_cafile_interCA2.crt)\n$(cat ${testdir}/set_cafile_rootCA.crt)\n\n" | socat "${tmpdir}/h1/stats" -
386 echo "commit ssl ca-file ${testdir}/set_cafile_interCA2.crt" | socat "${tmpdir}/h1/stats" -
387}
388
389client c13 -connect ${h1_backenderrorslst_sock} {
390 txreq
391 rxresp
392 expect resp.status == 200
393} -run
394barrier b2 sync
395client c14 -connect ${h1_backenderrorslst_sock} {
396 txreq
397} -run
398barrier b2 sync
399client c15 -connect ${h1_backenderrorslst_sock} {
400 txreq
401} -run
402barrier b2 sync
403client c16 -connect ${h1_backenderrorslst_sock} {
404 txreq
405} -run
406barrier b2 sync
407client c17 -connect ${h1_backenderrorslst_sock} {
408 txreq
409} -run
410barrier b2 sync
411client c18 -connect ${h1_backenderrorslst_sock} {
412 txreq
413} -run
414
Remi Tricot-Le Breton54f63832021-07-29 09:45:54 +0200415syslog Slg_cust_fmt -wait
416syslog Slg_https_fmt -wait
417syslog Slg_https_fmt_err -wait
418syslog Slg_logconnerror -wait
Remi Tricot-Le Bretonb061fb32021-09-01 15:52:16 +0200419syslog Slg_bcknd -wait
Remi Tricot-Le Bretona9967632022-01-07 17:12:01 +0100420syslog Slg_bcknd_fe -wait