Events: dns:fail Bug 3011
[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
39 # ----- Routers -----
40
41 begin routers
42
43 server_dump:
44   driver = redirect
45   condition = ${if eq {SERVER}{server}{yes}{no}}
46   data = :blackhole:
47
48 client_x:
49   driver = accept
50   local_parts = userx
51   retry_use_local_part
52   transport = send_to_server_failcert
53   errors_to = ""
54
55 client_y:
56   driver = accept
57   local_parts = usery
58   retry_use_local_part
59   transport = send_to_server_retry
60
61 client_z:
62   driver = accept
63   local_parts = userz
64   retry_use_local_part
65   transport = send_to_server_crypt
66
67 client_q:
68   driver = accept
69   local_parts = userq
70   retry_use_local_part
71   transport = send_to_server_req_fail
72
73 client_r:
74   driver = accept
75   local_parts = userr
76   retry_use_local_part
77   transport = send_to_server_req_failname
78
79 client_s:
80   driver = accept
81   local_parts = user_s
82   retry_use_local_part
83   transport = send_to_server_req_passname
84
85 client_t:
86   driver = accept
87   local_parts = usert
88   retry_use_local_part
89   transport = send_to_server_req_failcarryon
90
91 # ----- Transports -----
92
93 begin transports
94
95 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
96 send_to_server_failcert:
97   driver = smtp
98   allow_localhost
99   hosts = HOSTIPV4
100   port = PORT_D
101   hosts_try_fastopen =  :
102   hosts_require_tls = HOSTIPV4
103
104   tls_verify_certificates = CA2
105
106 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
107 send_to_server_retry:
108   driver = smtp
109   allow_localhost
110   hosts = HOSTIPV4 : 127.0.0.1
111   port = PORT_D
112   hosts_try_fastopen =  :
113   hosts_require_tls = HOSTIPV4
114
115   tls_verify_certificates = \
116     ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
117
118 # this will fail to verify the cert but continue unverified though crypted
119 send_to_server_crypt:
120   driver = smtp
121   allow_localhost
122   hosts = HOSTIPV4
123   port = PORT_D
124   hosts_try_fastopen =  :
125   hosts_require_tls = HOSTIPV4
126
127   tls_verify_certificates = CA2
128   tls_try_verify_hosts = *
129
130 # this will fail to verify the cert at HOSTNAME and fallback to unencrypted
131 # Fail due to lack of correct CA
132 send_to_server_req_fail:
133   driver = smtp
134   allow_localhost
135   hosts = HOSTNAME
136   port = PORT_D
137   hosts_try_fastopen =  :
138
139   tls_verify_certificates = CA2
140   tls_verify_hosts = *
141
142 # this will fail to verify the cert name and fallback to unencrypted
143 # fail because the cert is "server1.example.com" and the test system is something else
144 send_to_server_req_failname:
145   driver = smtp
146   allow_localhost
147   hosts = HOSTNAME
148   port = PORT_D
149   hosts_try_fastopen =  :
150
151   tls_verify_certificates = CA1
152   tls_verify_cert_hostnames = *
153   tls_verify_hosts = *
154
155 # this will pass the cert verify including name check
156 # our stunt DNS has an A record for server1.example.com -> HOSTIPV4
157 send_to_server_req_passname:
158   driver = smtp
159   allow_localhost
160   hosts = server1.example.com
161   port = PORT_D
162   hosts_try_fastopen =  :
163
164   tls_verify_certificates = CA1
165   tls_verify_cert_hostnames = *
166   tls_verify_hosts = *
167
168 # this will fail to verify the cert name but carry on (try-verify mode)
169 # fail because the cert is "server1.example.com" and the test system is something else
170 send_to_server_req_failcarryon:
171   driver = smtp
172   allow_localhost
173   hosts = HOSTNAME
174   port = PORT_D
175   hosts_try_fastopen =  :
176
177   tls_verify_certificates = CA1
178   tls_verify_cert_hostnames = *
179   tls_try_verify_hosts = *
180
181 # End