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}
45 condition = ${if eq {SERVER}{server}{yes}{no}}
52 transport = send_to_server_failcert
59 transport = send_to_server_retry
65 transport = send_to_server_crypt
71 transport = send_to_server_req_fail
77 transport = send_to_server_req_failname
83 transport = send_to_server_req_passname
89 transport = send_to_server_req_failcarryon
91 # ----- Transports -----
95 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
96 send_to_server_failcert:
101 hosts_try_fastopen = :
102 hosts_require_tls = HOSTIPV4
104 tls_verify_certificates = CA2
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:
110 hosts = HOSTIPV4 : 127.0.0.1
112 hosts_try_fastopen = :
113 hosts_require_tls = HOSTIPV4
115 tls_verify_certificates = \
116 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
118 # this will fail to verify the cert but continue unverified though crypted
119 send_to_server_crypt:
124 hosts_try_fastopen = :
125 hosts_require_tls = HOSTIPV4
127 tls_verify_certificates = CA2
128 tls_try_verify_hosts = *
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:
137 hosts_try_fastopen = :
139 tls_verify_certificates = CA2
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:
149 hosts_try_fastopen = :
151 tls_verify_certificates = CA1
152 tls_verify_cert_hostnames = *
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:
160 hosts = server1.example.com
162 hosts_try_fastopen = :
164 tls_verify_certificates = CA1
165 tls_verify_cert_hostnames = *
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:
175 hosts_try_fastopen = :
177 tls_verify_certificates = CA1
178 tls_verify_cert_hostnames = *
179 tls_try_verify_hosts = *