Testtsuite: portability
[exim.git] / test / confs / 2033
1 # Exim test configuration 2033
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 = users
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 # ----- Transports -----
95
96 begin transports
97
98 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
99 send_to_server_failcert:
100 driver = smtp
101 allow_localhost
102 hosts = HOSTIPV4
103 port = PORT_D
104 hosts_try_fastopen = :
105 hosts_require_tls = HOSTIPV4
106 tls_certificate = CERT2
107 tls_privatekey = CERT2
108
109 tls_verify_certificates = CA2
110
111 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
112 send_to_server_retry:
113 driver = smtp
114 allow_localhost
115 hosts = HOSTIPV4 : 127.0.0.1
116 port = PORT_D
117 hosts_try_fastopen = :
118 hosts_require_tls = HOSTIPV4
119 tls_certificate = CERT2
120 tls_privatekey = CERT2
121
122 tls_verify_certificates = \
123 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
124
125 # this will fail to verify the cert but continue unverified though crypted
126 send_to_server_crypt:
127 driver = smtp
128 allow_localhost
129 hosts = HOSTIPV4
130 port = PORT_D
131 hosts_try_fastopen = :
132 hosts_require_tls = HOSTIPV4
133 tls_certificate = CERT2
134 tls_privatekey = CERT2
135
136 tls_verify_certificates = CA2
137 tls_try_verify_hosts = *
138
139 # this will fail to verify the cert at HOSTNAME and fallback to unencrypted
140 # Fail due to lack of correct CA
141 send_to_server_req_fail:
142 driver = smtp
143 allow_localhost
144 hosts = HOSTNAME
145 port = PORT_D
146 hosts_try_fastopen = :
147 tls_certificate = CERT2
148 tls_privatekey = CERT2
149
150 tls_verify_certificates = CA2
151 tls_verify_hosts = *
152
153 # this will fail to verify the cert name and fallback to unencrypted
154 # fail because the cert is "server1.example.com" and the test system is something else
155 send_to_server_req_failname:
156 driver = smtp
157 allow_localhost
158 hosts = HOSTNAME
159 port = PORT_D
160 hosts_try_fastopen = :
161 tls_certificate = CERT2
162 tls_privatekey = CERT2
163
164 tls_verify_certificates = CA1
165 tls_verify_cert_hostnames = *
166 tls_verify_hosts = *
167
168 # this will pass the cert verify including name check
169 # our stunt DNS has an A record for server1.example.com -> HOSTIPV4
170 send_to_server_req_passname:
171 driver = smtp
172 allow_localhost
173 hosts = server1.example.com
174 port = PORT_D
175 hosts_try_fastopen = :
176 tls_certificate = CERT2
177 tls_privatekey = CERT2
178
179 tls_verify_certificates = CA1
180 tls_verify_cert_hostnames = *
181 tls_verify_hosts = *
182
183 # this will fail to verify the cert name but carry on (try-verify mode)
184 # fail because the cert is "server1.example.com" and the test system is something else
185 send_to_server_req_failcarryon:
186 driver = smtp
187 allow_localhost
188 hosts = HOSTNAME
189 port = PORT_D
190 hosts_try_fastopen = :
191 tls_certificate = CERT2
192 tls_privatekey = CERT2
193
194 tls_verify_certificates = CA1
195 tls_verify_cert_hostnames = *
196 tls_try_verify_hosts = *
197
198 # End