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