2022-07-05 12:50:17 +00:00
|
|
|
varnishtest "H1 authority validation and host normalizarion based on the scheme (rfc3982 6.3.2) or the method (connect)"
|
|
|
|
|
|
|
|
feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.6-dev0)'"
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 cond 2 -cyclic
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
syslog S1 -level info {
|
|
|
|
# C1
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http://toto:poue@hostname/c1 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-07-05 12:50:17 +00:00
|
|
|
|
|
|
|
# C2
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http://hostname:8080/c2 HTTP/1.1; host: {hostname:8080}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-07-05 12:50:17 +00:00
|
|
|
|
|
|
|
# C3
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https://hostname/c3 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-07-05 12:50:17 +00:00
|
|
|
|
|
|
|
# C4
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https://hostname:80/c4 HTTP/1.1; host: {hostname:80}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-07-05 12:50:17 +00:00
|
|
|
|
|
|
|
# C5
|
|
|
|
recv
|
2022-11-22 14:39:12 +00:00
|
|
|
expect ~ "^.* uri: CONNECT hostname:80 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-07-05 12:50:17 +00:00
|
|
|
recv
|
2022-11-22 14:39:12 +00:00
|
|
|
expect ~ "^.* uri: CONNECT hostname:80 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: CONNECT hostname:80 HTTP/1.1; host: {hostname:}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-07-05 12:50:17 +00:00
|
|
|
|
|
|
|
# C6
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: CONNECT hostname:443 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-07-05 12:50:17 +00:00
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: CONNECT hostname:443 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: CONNECT hostname:443 HTTP/1.1; host: {hostname:}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-07-05 12:50:17 +00:00
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# C7
|
2022-07-05 12:50:17 +00:00
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: CONNECT hostname:8443 HTTP/1.1; host: {hostname:8443}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C8
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C9
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C10
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C11
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C12
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C13
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C14
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C15
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C16
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C17
|
|
|
|
recv
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
|
|
|
|
|
|
|
# C18
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C19
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: <BADREQ>; host: $"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C20
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http://hostname/c20 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C21
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https://hostname/c21 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C22
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http://hostname/c22 HTTP/1.1; host: {hostname:80}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C23
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https://hostname/c23 HTTP/1.1; host: {hostname:443}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C24
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http://hostname/c24 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C25
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https://hostname/c25 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C26
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http://hostname/c26 HTTP/1.1; host: {hostname:}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C27
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https://hostname/c27 HTTP/1.1; host: {hostname:}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C28
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http://hostname/c28 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C29
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http://hostname/c29 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C30
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https://hostname/c30 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C31
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https://hostname/c31 HTTP/1.1; host: {hostname}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C32
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http:// HTTP/1.1; host: {}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C33
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https:// HTTP/1.1; host: {}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C34
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET http:// HTTP/1.1; host: {}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
barrier b1 sync
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# C35
|
|
|
|
recv
|
|
|
|
expect ~ "^.* uri: GET https:// HTTP/1.1; host: {}$"
|
2023-06-19 17:00:52 +00:00
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
} -start
|
|
|
|
|
|
|
|
haproxy h1 -conf {
|
|
|
|
defaults
|
|
|
|
mode http
|
|
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
|
|
|
|
frontend fe
|
|
|
|
bind "fd@${fe}"
|
|
|
|
|
|
|
|
http-request capture req.hdr(host) len 512
|
|
|
|
log-format "uri: %r; host: %hr"
|
|
|
|
log ${S1_addr}:${S1_port} len 2048 local0 debug err
|
|
|
|
|
|
|
|
http-request return status 200
|
|
|
|
} -start
|
|
|
|
|
|
|
|
# default port 80 with http scheme => should be normalized
|
|
|
|
# Be sure userinfo are skipped
|
|
|
|
client c1 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://toto:poue@hostname:80/c1" \
|
|
|
|
-hdr "host: hostname:80"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# port 8080 with http scheme => no normalization
|
|
|
|
client c2 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname:8080/c2" \
|
|
|
|
-hdr "host: hostname:8080"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# default port 443 with https scheme => should be normalized
|
|
|
|
client c3 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://hostname:443/c3" \
|
|
|
|
-hdr "host: hostname:443"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# port 80 with https scheme => no normalization
|
|
|
|
client c4 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://hostname:80/c4" \
|
|
|
|
-hdr "host: hostname:80"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# CONNECT on port 80 => should be normalized
|
|
|
|
client c5 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
2022-11-22 14:39:12 +00:00
|
|
|
-url "hostname:80" \
|
2022-07-05 12:50:17 +00:00
|
|
|
-hdr "host: hostname:80"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
2023-06-19 17:00:52 +00:00
|
|
|
|
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
client c5 -connect ${h1_fe_sock} {
|
|
|
|
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
2022-11-22 14:39:12 +00:00
|
|
|
-url "hostname:80" \
|
2022-07-05 12:50:17 +00:00
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
2023-06-19 17:00:52 +00:00
|
|
|
|
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
client c5 -connect ${h1_fe_sock} {
|
|
|
|
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname:80" \
|
|
|
|
-hdr "host: hostname:"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
2022-07-05 12:50:17 +00:00
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# CONNECT on port 443 => should be normalized
|
|
|
|
client c6 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname:443" \
|
|
|
|
-hdr "host: hostname:443"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
2023-06-19 17:00:52 +00:00
|
|
|
|
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
client c6 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname:443" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
2023-06-19 17:00:52 +00:00
|
|
|
|
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
client c6 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname:443" \
|
|
|
|
-hdr "host: hostname:"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
2022-07-05 12:50:17 +00:00
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# CONNECT on port non-default port => no normalization
|
|
|
|
client c7 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname:8443" \
|
|
|
|
-hdr "host: hostname:8443"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# host miss-match => error
|
|
|
|
client c8 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname1/" \
|
|
|
|
-hdr "host: hostname2"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# port miss-match => error
|
|
|
|
client c9 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname:80/" \
|
|
|
|
-hdr "host: hostname:81"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# no host port with a non-default port in abs-uri => error
|
|
|
|
client c10 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname:8080/" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# non-default host port with a default in abs-uri => error
|
|
|
|
client c11 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname/" \
|
|
|
|
-hdr "host: hostname:81"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# miss-match between host headers => error
|
|
|
|
client c12 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname1/" \
|
|
|
|
-hdr "host: hostname1" \
|
|
|
|
-hdr "host: hostname2"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# miss-match between host headers but with a normalization => error
|
|
|
|
client c13 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname1/" \
|
|
|
|
-hdr "host: hostname1:80" \
|
|
|
|
-hdr "host: hostname1"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# CONNECT authoriy without port => error
|
|
|
|
client c14 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# host miss-match with CONNECT => error
|
|
|
|
client c15 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname1:80" \
|
|
|
|
-hdr "host: hostname2:80"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# port miss-match with CONNECT => error
|
|
|
|
client c16 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname:80" \
|
|
|
|
-hdr "host: hostname:443"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# no host port with non-default port in CONNECT authority => error
|
|
|
|
client c17 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname:8080" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
# no authority => error
|
|
|
|
client c18 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "/" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# no authority => error
|
|
|
|
client c19 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "CONNECT" \
|
|
|
|
-url "hostname:" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 400
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# default port 80 with http scheme but no port for host value => should be normalized
|
|
|
|
client c20 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname:80/c20" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# default port 443 with https scheme but no port for host value => should be normalized
|
|
|
|
client c21 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://hostname:443/c21" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# http scheme, no port for the authority but default port for host value => no normalization
|
|
|
|
client c22 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname/c22" \
|
|
|
|
-hdr "host: hostname:80"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# https scheme, no port for the authority but default port for host value => no normalization
|
|
|
|
client c23 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://hostname/c23" \
|
|
|
|
-hdr "host: hostname:443"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
# http scheme, empty port for the authority and no port for host value => should be normalized
|
|
|
|
client c24 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname:/c24" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# https scheme, empty port for the authority and no port for host value => should be normalized
|
|
|
|
client c25 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://hostname:/c25" \
|
|
|
|
-hdr "host: hostname"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# http scheme, no port for the authority and empty port for host value => no normalization
|
|
|
|
client c26 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname/c26" \
|
|
|
|
-hdr "host: hostname:"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# https scheme, no port for the authority and empty port for host value => no normalization
|
|
|
|
client c27 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://hostname/c27" \
|
|
|
|
-hdr "host: hostname:"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# http scheme, default port for the authority and empty port for host value => should be normalized
|
|
|
|
client c28 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname:80/c28" \
|
|
|
|
-hdr "host: hostname:"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# http scheme, empty port for the authority and default port for host value => should be normalized
|
|
|
|
client c29 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://hostname:/c29" \
|
|
|
|
-hdr "host: hostname:80"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# https scheme, default port for the authority and empty port for host value => should be normalized
|
|
|
|
client c30 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://hostname:443/c30" \
|
|
|
|
-hdr "host: hostname:"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# https scheme, empty port for the authority and default port for host value => should be normalized
|
|
|
|
client c31 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://hostname:/c31" \
|
|
|
|
-hdr "host: hostname:443"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# Strange cases
|
|
|
|
client c32 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://:" \
|
|
|
|
-hdr "host: :80"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
client c33 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://:" \
|
|
|
|
-hdr "host: :443"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
# Strange cases
|
|
|
|
client c34 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "http://:" \
|
|
|
|
-hdr "host: :"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2023-06-19 17:00:52 +00:00
|
|
|
# Wait matching on log message
|
|
|
|
barrier b1 sync
|
|
|
|
|
2022-11-22 14:39:12 +00:00
|
|
|
|
|
|
|
client c35 -connect ${h1_fe_sock} {
|
|
|
|
txreq \
|
|
|
|
-req "GET" \
|
|
|
|
-url "https://:" \
|
|
|
|
-hdr "host: :"
|
|
|
|
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
2022-07-05 12:50:17 +00:00
|
|
|
syslog S1 -wait
|