1 # Exim test configuration 2012
2 # TLS client: verify certificate from server - fails
6 .include DIR/aux-var/tls_conf_prefix
8 primary_hostname = myhost.test.ex
11 S1 = FX/exim-ca/example.com/server1.example.com
14 CERT1 = S1/server1.example.com.pem
15 KEY1 = S1/server1.example.com.unlocked.key
20 # ----- Main settings -----
22 acl_smtp_rcpt = accept
24 log_selector = +tls_peerdn+tls_certificate_verified
29 tls_advertise_hosts = *
31 # Set certificate only if server
33 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
34 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
37 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
46 condition = ${if eq {SERVER}{server}{yes}{no}}
53 transport = send_to_server_failcert
60 transport = send_to_server_retry
66 transport = send_to_server_crypt
72 transport = send_to_server_req_fail
78 transport = send_to_server_req_failname
84 transport = send_to_server_req_passname
90 transport = send_to_server_req_failchain
96 transport = send_to_server_req_passchain
99 # ----- Transports -----
103 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
104 send_to_server_failcert:
109 hosts_try_fastopen = :
110 hosts_require_tls = HOSTIPV4
111 tls_certificate = CERT2
112 tls_privatekey = CERT2
114 tls_verify_certificates = CA2
115 tls_try_verify_hosts =
116 tls_verify_cert_hostnames =
118 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
119 send_to_server_retry:
122 hosts = HOSTIPV4 : 127.0.0.1
124 hosts_try_fastopen = :
125 hosts_require_tls = HOSTIPV4
126 tls_certificate = CERT2
127 tls_privatekey = CERT2
129 tls_verify_certificates = \
130 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
131 tls_try_verify_hosts =
132 tls_verify_cert_hostnames =
134 # this will fail to verify the cert but continue unverified though crypted
135 send_to_server_crypt:
140 hosts_try_fastopen = :
141 hosts_require_tls = HOSTIPV4
142 tls_certificate = CERT2
143 tls_privatekey = CERT2
145 tls_verify_certificates = CA2
146 tls_try_verify_hosts = *
147 tls_verify_cert_hostnames =
149 # this will fail to verify the cert at HOSTIPV4 and fallback to unencrypted
150 send_to_server_req_fail:
155 hosts_try_fastopen = :
156 tls_certificate = CERT2
157 tls_privatekey = CERT2
159 tls_verify_certificates = CA2
161 tls_verify_cert_hostnames =
163 # this will fail to verify the cert name and fallback to unencrypted
164 send_to_server_req_failname:
167 hosts = serverbadname.example.com
169 hosts_try_fastopen = :
170 tls_certificate = CERT2
171 tls_privatekey = CERT2
173 tls_verify_certificates = CA1
174 tls_verify_cert_hostnames = HOSTIPV4
177 # this will pass the cert verify including name check
178 send_to_server_req_passname:
181 hosts = server1.example.com
183 hosts_try_fastopen = :
184 tls_certificate = CERT2
185 tls_privatekey = CERT2
187 tls_verify_certificates = CA1
188 tls_verify_cert_hostnames = HOSTIPV4
191 # this will fail the cert verify name check, because CNAME rules
192 send_to_server_req_failchain:
195 hosts = serverchain1.example.com
197 hosts_try_fastopen = :
198 tls_certificate = CERT2
199 tls_privatekey = CERT2
201 tls_verify_certificates = CA1
202 tls_verify_cert_hostnames = HOSTIPV4
205 # this will pass the cert verify name check, because CNAME rules
206 send_to_server_req_passchain:
209 hosts = alternatename.server1.example.com
211 hosts_try_fastopen = :
212 tls_certificate = CERT2
213 tls_privatekey = CERT2
215 tls_verify_certificates = CA1
216 tls_verify_cert_hostnames = HOSTIPV4