REGTEST: Add connection/proxy_protocol_send_unique_id_alpn
This reg-test checks that sending unique IDs via PPv2 works for servers with the `alpn` option specified (issue #640). As a side effect it also checks that PPv2 works with ALPN (issue #651). It has been verified that the test fails without the following commits applied and succeeds with them applied. 1f9a4ecea BUG/MEDIUM: backend: set the connection owner to the session when using alpn. 083fd42d5 BUG/MEDIUM: connection: Ignore PP2 unique ID for stream-less connections eb9ba3cb2 BUG/MINOR: connection: Always get the stream when available to send PP2 line Without the first two commits HAProxy crashes during execution of the test. Without the last commit the test will fail, because no unique ID is received.
This commit is contained in:
parent
63a8738724
commit
9947f77a59
|
@ -0,0 +1,33 @@
|
||||||
|
varnishtest "Check that the unique ID TLV is properly sent for servers with ALPN option"
|
||||||
|
|
||||||
|
#REQUIRE_VERSION=2.2
|
||||||
|
#REQUIRE_OPTIONS=OPENSSL
|
||||||
|
|
||||||
|
feature ignore_unknown_macro
|
||||||
|
|
||||||
|
haproxy h1 -conf {
|
||||||
|
defaults
|
||||||
|
mode http
|
||||||
|
log global
|
||||||
|
unique-id-format %{+X}o\ TEST-%[req.hdr(in)]
|
||||||
|
|
||||||
|
listen sender
|
||||||
|
bind "fd@${feS}"
|
||||||
|
|
||||||
|
server example ${h1_feR_addr}:${h1_feR_port} send-proxy-v2 proxy-v2-options unique-id ssl alpn XXX verify none
|
||||||
|
|
||||||
|
listen receiver
|
||||||
|
bind "fd@${feR}" ssl crt ${testdir}/common.pem accept-proxy
|
||||||
|
|
||||||
|
http-request set-var(txn.proxy_unique_id) fc_pp_unique_id
|
||||||
|
http-after-response set-header proxy_unique_id %[var(txn.proxy_unique_id)]
|
||||||
|
http-request return status 200
|
||||||
|
} -start
|
||||||
|
|
||||||
|
# Validate that a correct header passes
|
||||||
|
client c1 -connect ${h1_feS_sock} {
|
||||||
|
txreq -url "/" \
|
||||||
|
-hdr "in: foo"
|
||||||
|
rxresp
|
||||||
|
expect resp.http.proxy_unique_id == "TEST-foo"
|
||||||
|
} -run
|
Loading…
Reference in New Issue