blob: 638debea0d2e90126feb758de85a1530f954bf76 [file] [log] [blame]
William Dauchyf6370442020-11-14 19:25:33 +01001varnishtest "Set server ssl via CLI"
2
3feature ignore_unknown_macro
4
5# for "set server <srv> ssl"
6#REQUIRE_VERSION=2.4
William Lallemanda1ef7542020-11-18 17:41:28 +01007#REGTEST_TYPE=devel
8#REQUIRE_OPTIONS=OPENSSL
William Dauchyf6370442020-11-14 19:25:33 +01009
10# Do nothing. Is there only to create s1_* macros
11server s1 {
12} -start
13
14haproxy h1 -conf {
15 global
16 ssl-server-verify none
17
18 defaults
19 mode http
20 ${no-htx} option http-use-htx
21 timeout connect 1s
22 timeout client 1s
23 timeout server 1s
24
25 frontend myfrontend
26 bind "fd@${my_fe}"
27 default_backend test0
28
29 backend test0
30 default-server ssl
31 server www0 ${s1_addr}:${s1_port} no-ssl
32
33 backend test1
34 server www0 ${s1_addr}:${s1_port} no-ssl
35} -start
36
37haproxy h1 -cli {
38 # supported case
39 send "show servers state test0"
40 expect ~ "test0 1 www0 ${s1_addr} .* - ${s1_port} - -1"
41 send "set server test0/www0 ssl on"
42 expect ~ "server ssl setting updated"
43 send "show servers state test0"
44 expect ~ "test0 1 www0 ${s1_addr} .* - ${s1_port} - 1"
45 send "set server test0/www0 ssl off"
46 expect ~ "server ssl setting updated"
47 send "show servers state test0"
48 expect ~ "test0 1 www0 ${s1_addr} .* - ${s1_port} - 0"
49
50 # unsupported case
51 send "show servers state test1"
52 expect ~ "test1 1 www0 ${s1_addr} .* - ${s1_port} - -1"
53 send "set server test1/www0 ssl on"
54 expect ~ "'set server <srv> ssl' cannot be set"
55} -wait