Support optional server certificate name checking. Bug 1479
[exim.git] / test / confs / 5450
CommitLineData
e51c7be2
JH
1# Exim test configuration 2112
2# TLS client: verify certificate from server - fails
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
91
92# ----- Transports -----
93
94begin transports
95
96# this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
97send_to_server_failcert:
98 driver = smtp
99 allow_localhost
100 hosts = HOSTIPV4
101 hosts_require_tls = HOSTIPV4
102 port = PORT_D
103 tls_certificate = CERT2
104 tls_privatekey = CERT2
105
106 tls_verify_certificates = CA2
107
108# this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
109send_to_server_retry:
110 driver = smtp
111 allow_localhost
112 hosts = HOSTIPV4 : 127.0.0.1
113 hosts_require_tls = HOSTIPV4
114 port = PORT_D
115 tls_certificate = CERT2
116 tls_privatekey = CERT2
117
118 tls_verify_certificates = \
119 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
120
121# this will fail to verify the cert but continue unverified though crypted
122send_to_server_crypt:
123 driver = smtp
124 allow_localhost
125 hosts = HOSTIPV4
126 hosts_require_tls = HOSTIPV4
127 port = PORT_D
128 tls_certificate = CERT2
129 tls_privatekey = CERT2
130
131 tls_verify_certificates = CA2
132 tls_try_verify_hosts = *
133
134# this will fail to verify the cert at HOSTIPV4 and fallback to unencrypted
135send_to_server_req_fail:
136 driver = smtp
137 allow_localhost
138 hosts = HOSTIPV4
139 port = PORT_D
140 tls_certificate = CERT2
141 tls_privatekey = CERT2
142
143 tls_verify_certificates = CA2
144 tls_verify_hosts = *
145
146# this will fail to verify the cert name and fallback to unencrypted
147send_to_server_req_failname:
148 driver = smtp
149 allow_localhost
150 hosts = HOSTIPV4
151 port = PORT_D
152 tls_certificate = CERT2
153 tls_privatekey = CERT2
154
155 tls_verify_certificates = CA1
156 tls_verify_cert_hostnames = server1.example.net : server1.example.org
157 tls_verify_hosts = *
158
159# this will pass the cert verify including name check
160send_to_server_req_passname:
161 driver = smtp
162 allow_localhost
163 hosts = HOSTIPV4
164 port = PORT_D
165 tls_certificate = CERT2
166 tls_privatekey = CERT2
167
168 tls_verify_certificates = CA1
169 tls_verify_cert_hostnames = noway.example.com : server1.example.com
170 tls_verify_hosts = *
171
172# End