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