2018-08-24 14:14:28 +00:00
|
|
|
#commit b406b87
|
|
|
|
# BUG/MEDIUM: connection: don't store recv() result into trash.data
|
|
|
|
#
|
|
|
|
# Cyril Bonté discovered that the proxy protocol randomly fails since
|
|
|
|
# commit 843b7cb ("MEDIUM: chunks: make the chunk struct's fields match
|
|
|
|
# the buffer struct"). This is because we used to store recv()'s return
|
|
|
|
# code into trash.data which is now unsigned, so it never compares as
|
|
|
|
# negative against 0. Let's clean this up and test the result itself
|
|
|
|
# without storing it first.
|
|
|
|
|
|
|
|
varnishtest "PROXY protocol random failures"
|
2019-04-17 07:19:56 +00:00
|
|
|
#REQUIRE_OPTIONS=OPENSSL
|
2018-08-24 14:14:28 +00:00
|
|
|
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
|
2020-11-21 14:33:03 +00:00
|
|
|
#REGTEST_TYPE=broken
|
2019-03-29 14:07:24 +00:00
|
|
|
|
2018-08-24 14:14:28 +00:00
|
|
|
syslog Slog_1 -repeat 8 -level info {
|
|
|
|
recv
|
|
|
|
expect ~ "Connect from .* to ${h1_ssl_addr}:${h1_ssl_port}"
|
|
|
|
recv
|
2019-10-14 14:22:03 +00:00
|
|
|
expect ~ "ssl-offload-http/http .* \"POST (https://.*:${h1_ssl_port})?/[1-8] HTTP/(2\\.0|1\\.1)\""
|
2018-08-24 14:14:28 +00:00
|
|
|
} -start
|
|
|
|
|
|
|
|
haproxy h1 -conf {
|
|
|
|
global
|
|
|
|
nbproc 4
|
|
|
|
tune.ssl.default-dh-param 2048
|
|
|
|
stats bind-process 1
|
|
|
|
log ${Slog_1_addr}:${Slog_1_port} len 2048 local0 debug err
|
|
|
|
|
|
|
|
defaults
|
|
|
|
mode http
|
2018-12-19 10:49:39 +00:00
|
|
|
${no-htx} option http-use-htx
|
2018-08-24 14:14:28 +00:00
|
|
|
timeout client 1s
|
|
|
|
timeout server 1s
|
|
|
|
timeout connect 1s
|
|
|
|
log global
|
|
|
|
|
|
|
|
listen http
|
|
|
|
bind-process 1
|
2018-12-20 08:55:44 +00:00
|
|
|
bind unix@"${tmpdir}/http.socket" accept-proxy name ssl-offload-http
|
2018-08-24 14:14:28 +00:00
|
|
|
option forwardfor
|
|
|
|
|
|
|
|
listen ssl-offload-http
|
|
|
|
option httplog
|
|
|
|
bind-process 2-4
|
|
|
|
bind "fd@${ssl}" ssl crt ${testdir}/common.pem ssl no-sslv3 alpn h2,http/1.1
|
2018-12-20 08:55:44 +00:00
|
|
|
server http unix@"${tmpdir}/http.socket" send-proxy
|
2018-08-24 14:14:28 +00:00
|
|
|
} -start
|
|
|
|
|
|
|
|
|
|
|
|
shell {
|
|
|
|
HOST=${h1_ssl_addr}
|
|
|
|
if [ "$HOST" = "::1" ] ; then
|
|
|
|
HOST="\[::1\]"
|
|
|
|
fi
|
|
|
|
for i in 1 2 3 4 5 6 7 8 ; do
|
|
|
|
urls="$urls https://$HOST:${h1_ssl_port}/$i"
|
|
|
|
done
|
|
|
|
curl -i -k -d 'x=x' $urls & wait $!
|
|
|
|
}
|
|
|
|
|
|
|
|
syslog Slog_1 -wait
|