Testsuite: unbreak testcase
[exim.git] / test / confs / 2133
1 # Exim test configuration 2133
2 # TLS client: verify certificate from server - name-fails
3
4 SERVER=
5
6 .include DIR/aux-var/tls_conf_prefix
7
8 primary_hostname = myhost.test.ex
9
10 FX = DIR/aux-fixed
11 S1 = FX/exim-ca/example.com/server1.example.com
12
13 CA1 = S1/ca_chain.pem
14 CERT1 = S1/server1.example.com.pem
15 KEY1 = S1/server1.example.com.unlocked.key
16 CA2 = FX/cert2
17 CERT2 = FX/cert2
18 KEY2 = FX/cert2
19
20 # ----- Main settings -----
21
22 disable_ipv6 = true
23
24 acl_smtp_rcpt = accept
25
26 log_selector = +tls_peerdn+tls_certificate_verified
27
28 queue_only
29 queue_run_in_order
30
31 tls_advertise_hosts = *
32
33 # Set certificate only if server
34
35 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
36 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
37
38 tls_verify_hosts = *
39 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
40
41
42 # ----- Routers -----
43
44 begin routers
45
46 server_dump:
47 driver = redirect
48 condition = ${if eq {SERVER}{server}{yes}{no}}
49 data = :blackhole:
50
51 client_x:
52 driver = accept
53 local_parts = userx
54 retry_use_local_part
55 transport = send_to_server_failcert
56 errors_to = ""
57
58 client_y:
59 driver = accept
60 local_parts = usery
61 retry_use_local_part
62 transport = send_to_server_retry
63
64 client_z:
65 driver = accept
66 local_parts = userz
67 retry_use_local_part
68 transport = send_to_server_crypt
69
70 client_q:
71 driver = accept
72 local_parts = userq
73 retry_use_local_part
74 transport = send_to_server_req_fail
75
76 client_r:
77 driver = accept
78 local_parts = userr
79 retry_use_local_part
80 transport = send_to_server_req_failname
81
82 client_s:
83 driver = accept
84 local_parts = user_s
85 retry_use_local_part
86 transport = send_to_server_req_passname
87
88 client_t:
89 driver = accept
90 local_parts = usert
91 retry_use_local_part
92 transport = send_to_server_req_failcarryon
93
94
95 # ----- Transports -----
96
97 begin transports
98
99 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
100 send_to_server_failcert:
101 driver = smtp
102 allow_localhost
103 hosts = HOSTIPV4
104 port = PORT_D
105 hosts_try_fastopen = :
106 hosts_require_tls = HOSTIPV4
107 tls_certificate = CERT2
108 tls_privatekey = CERT2
109
110 tls_verify_certificates = CA2
111
112 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
113 send_to_server_retry:
114 driver = smtp
115 allow_localhost
116 hosts = HOSTIPV4 : 127.0.0.1
117 port = PORT_D
118 hosts_try_fastopen = :
119 hosts_require_tls = HOSTIPV4
120 tls_certificate = CERT2
121 tls_privatekey = CERT2
122
123 tls_verify_certificates = \
124 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
125
126 # this will fail to verify the cert but continue unverified though crypted
127 send_to_server_crypt:
128 driver = smtp
129 allow_localhost
130 hosts = HOSTIPV4
131 port = PORT_D
132 hosts_try_fastopen = :
133 hosts_require_tls = HOSTIPV4
134 tls_certificate = CERT2
135 tls_privatekey = CERT2
136
137 tls_verify_certificates = CA2
138 tls_try_verify_hosts = *
139
140 # this will fail to verify the cert at HOSTNAME and fallback to unencrypted
141 # Fail due to lack of correct CA
142 send_to_server_req_fail:
143 driver = smtp
144 allow_localhost
145 hosts = HOSTNAME
146 port = PORT_D
147 hosts_try_fastopen = :
148 tls_certificate = CERT2
149 tls_privatekey = CERT2
150
151 tls_verify_certificates = CA2
152 tls_verify_hosts = *
153
154 # this will fail to verify the cert name and fallback to unencrypted
155 # fail because the cert is "server1.example.com" and the test system is something else
156 send_to_server_req_failname:
157 driver = smtp
158 allow_localhost
159 hosts = HOSTNAME
160 port = PORT_D
161 hosts_try_fastopen = :
162 tls_certificate = CERT2
163 tls_privatekey = CERT2
164
165 tls_verify_certificates = CA1
166 tls_verify_cert_hostnames = *
167 tls_verify_hosts = *
168
169 # this will pass the cert verify including name check
170 # our stunt DNS has an A record for server1.example.com -> HOSTIPV4
171 send_to_server_req_passname:
172 driver = smtp
173 allow_localhost
174 hosts = server1.example.com
175 port = PORT_D
176 hosts_try_fastopen = :
177 tls_certificate = CERT2
178 tls_privatekey = CERT2
179
180 tls_verify_certificates = CA1
181 tls_verify_cert_hostnames = *
182 tls_verify_hosts = *
183
184 send_to_server_req_failcarryon:
185 driver = smtp
186 allow_localhost
187 hosts = HOSTNAME
188 port = PORT_D
189 hosts_try_fastopen = :
190 tls_certificate = CERT2
191 tls_privatekey = CERT2
192
193 tls_verify_certificates = CA1
194 tls_verify_cert_hostnames = *
195 tls_try_verify_hosts = *
196
197 # End