1 # Exim test configuration 2033
2 # TLS client: verify certificate from server - name-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 -----
24 acl_smtp_rcpt = accept
26 log_selector = +tls_peerdn+tls_certificate_verified
31 tls_advertise_hosts = *
33 # Set certificate only if server
35 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
36 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
39 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
48 condition = ${if eq {SERVER}{server}{yes}{no}}
55 transport = send_to_server_failcert
62 transport = send_to_server_retry
68 transport = send_to_server_crypt
74 transport = send_to_server_req_fail
80 transport = send_to_server_req_failname
86 transport = send_to_server_req_passname
92 transport = send_to_server_req_failcarryon
94 # ----- Transports -----
98 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
99 send_to_server_failcert:
103 hosts_require_tls = HOSTIPV4
105 tls_certificate = CERT2
106 tls_privatekey = CERT2
108 tls_verify_certificates = CA2
110 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
111 send_to_server_retry:
114 hosts = HOSTIPV4 : 127.0.0.1
115 hosts_require_tls = HOSTIPV4
117 tls_certificate = CERT2
118 tls_privatekey = CERT2
120 tls_verify_certificates = \
121 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
123 # this will fail to verify the cert but continue unverified though crypted
124 send_to_server_crypt:
128 hosts_require_tls = HOSTIPV4
130 tls_certificate = CERT2
131 tls_privatekey = CERT2
133 tls_verify_certificates = CA2
134 tls_try_verify_hosts = *
136 # this will fail to verify the cert at HOSTNAME and fallback to unencrypted
137 # Fail due to lack of correct CA
138 send_to_server_req_fail:
143 tls_certificate = CERT2
144 tls_privatekey = CERT2
146 tls_verify_certificates = CA2
149 # this will fail to verify the cert name and fallback to unencrypted
150 # fail because the cert is "server1.example.com" and the test system is something else
151 send_to_server_req_failname:
156 tls_certificate = CERT2
157 tls_privatekey = CERT2
159 tls_verify_certificates = CA1
160 tls_verify_cert_hostnames = *
163 # this will pass the cert verify including name check
164 # our stunt DNS has an A record for server1.example.com -> HOSTIPV4
165 send_to_server_req_passname:
168 hosts = server1.example.com
170 tls_certificate = CERT2
171 tls_privatekey = CERT2
173 tls_verify_certificates = CA1
174 tls_verify_cert_hostnames = *
177 # this will fail to verify the cert name but carry on (try-verify mode)
178 # fail because the cert is "server1.example.com" and the test system is something else
179 send_to_server_req_failcarryon:
184 tls_certificate = CERT2
185 tls_privatekey = CERT2
187 tls_verify_certificates = CA1
188 tls_verify_cert_hostnames = *
189 tls_try_verify_hosts = *