Fix CVE-2016-1531
[exim.git] / test / confs / 5440
1 # Exim test configuration 2012
2 # TLS client: verify certificate from server - 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 rfc1413_query_timeout = 0s
11 spool_directory = DIR/spool
12 log_file_path = DIR/spool/log/SERVER%slog
13 gecos_pattern = ""
14 gecos_name = CALLER_NAME
15
16 FX = DIR/aux-fixed
17 S1 = FX/exim-ca/example.com/server1.example.com
18
19 CA1 =   S1/ca_chain.pem 
20 CERT1 = S1/server1.example.com.pem
21 KEY1 =  S1/server1.example.com.unlocked.key
22 CA2 =   FX/cert2
23 CERT2 = FX/cert2
24 KEY2 =  FX/cert2
25
26 # ----- Main settings -----
27
28 acl_smtp_rcpt = accept
29
30 log_selector =  +tls_peerdn+tls_certificate_verified
31
32 queue_only
33 queue_run_in_order
34
35 tls_advertise_hosts = *
36
37 # Set certificate only if server
38
39 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
40 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
41
42 tls_verify_hosts = *
43 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
44
45
46 # ----- Routers -----
47
48 begin routers
49
50 server_dump:
51   driver = redirect
52   condition = ${if eq {SERVER}{server}{yes}{no}}
53   data = :blackhole:
54
55 client_x:
56   driver = accept
57   local_parts = userx
58   retry_use_local_part
59   transport = send_to_server_failcert
60   errors_to = ""
61
62 client_y:
63   driver = accept
64   local_parts = usery
65   retry_use_local_part
66   transport = send_to_server_retry
67
68 client_z:
69   driver = accept
70   local_parts = userz
71   retry_use_local_part
72   transport = send_to_server_crypt
73
74 client_q:
75   driver = accept
76   local_parts = userq
77   retry_use_local_part
78   transport = send_to_server_req_fail
79
80 client_r:
81   driver = accept
82   local_parts = userr
83   retry_use_local_part
84   transport = send_to_server_req_failname
85
86 client_s:
87   driver = accept
88   local_parts = users
89   retry_use_local_part
90   transport = send_to_server_req_passname
91
92
93 # ----- Transports -----
94
95 begin transports
96
97 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
98 send_to_server_failcert:
99   driver = smtp
100   allow_localhost
101   hosts = HOSTIPV4
102   hosts_require_tls = HOSTIPV4
103   port = PORT_D
104   tls_certificate = CERT2
105   tls_privatekey = CERT2
106
107   tls_verify_certificates = CA2
108
109 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
110 send_to_server_retry:
111   driver = smtp
112   allow_localhost
113   hosts = HOSTIPV4 : 127.0.0.1
114   hosts_require_tls = HOSTIPV4
115   port = PORT_D
116   tls_certificate = CERT2
117   tls_privatekey = CERT2
118
119   tls_verify_certificates = \
120     ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
121
122 # this will fail to verify the cert but continue unverified though crypted
123 send_to_server_crypt:
124   driver = smtp
125   allow_localhost
126   hosts = HOSTIPV4
127   hosts_require_tls = HOSTIPV4
128   port = PORT_D
129   tls_certificate = CERT2
130   tls_privatekey = CERT2
131
132   tls_verify_certificates = CA2
133   tls_try_verify_hosts = *
134
135 # this will fail to verify the cert at HOSTIPV4 and fallback to unencrypted
136 send_to_server_req_fail:
137   driver = smtp
138   allow_localhost
139   hosts = HOSTIPV4
140   port = PORT_D
141   tls_certificate = CERT2
142   tls_privatekey = CERT2
143
144   tls_verify_certificates = CA2
145   tls_verify_hosts = *
146
147 # this will fail to verify the cert name and fallback to unencrypted
148 send_to_server_req_failname:
149   driver = smtp
150   allow_localhost
151   hosts = HOSTIPV4
152   port = PORT_D
153   tls_certificate = CERT2
154   tls_privatekey = CERT2
155
156   tls_verify_certificates = CA1
157   tls_verify_cert_hostnames = server1.example.net : server1.example.org
158   tls_verify_hosts = *
159
160 # this will pass the cert verify including name check
161 send_to_server_req_passname:
162   driver = smtp
163   allow_localhost
164   hosts = HOSTIPV4
165   port = PORT_D
166   tls_certificate = CERT2
167   tls_privatekey = CERT2
168
169   tls_verify_certificates = CA1
170   tls_verify_cert_hostnames = noway.example.com : server1.example.com
171   tls_verify_hosts = *
172
173 # End