1 # Exim test configuration 2133
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
95 # ----- Transports -----
99 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
100 send_to_server_failcert:
105 hosts_try_fastopen = :
106 hosts_require_tls = HOSTIPV4
107 tls_certificate = CERT2
108 tls_privatekey = CERT2
110 tls_verify_certificates = CA2
112 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
113 send_to_server_retry:
116 hosts = HOSTIPV4 : 127.0.0.1
118 hosts_try_fastopen = :
119 hosts_require_tls = HOSTIPV4
120 tls_certificate = CERT2
121 tls_privatekey = CERT2
123 tls_verify_certificates = \
124 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
126 # this will fail to verify the cert but continue unverified though crypted
127 send_to_server_crypt:
132 hosts_try_fastopen = :
133 hosts_require_tls = HOSTIPV4
134 tls_certificate = CERT2
135 tls_privatekey = CERT2
137 tls_verify_certificates = CA2
138 tls_try_verify_hosts = *
140 # this will fail to verify the cert at HOSTNAME and fallback to unencrypted
141 # Fail due to lack of correct CA
142 send_to_server_req_fail:
147 hosts_try_fastopen = :
148 tls_certificate = CERT2
149 tls_privatekey = CERT2
151 tls_verify_certificates = CA2
154 # this will fail to verify the cert name and fallback to unencrypted
155 # fail because the cert is "server1.example.com" and the test system is something else
156 send_to_server_req_failname:
161 hosts_try_fastopen = :
162 tls_certificate = CERT2
163 tls_privatekey = CERT2
165 tls_verify_certificates = CA1
166 tls_verify_cert_hostnames = *
169 # this will pass the cert verify including name check
170 # our stunt DNS has an A record for server1.example.com -> HOSTIPV4
171 send_to_server_req_passname:
174 hosts = server1.example.com
176 hosts_try_fastopen = :
177 tls_certificate = CERT2
178 tls_privatekey = CERT2
180 tls_verify_certificates = CA1
181 tls_verify_cert_hostnames = *
184 send_to_server_req_failcarryon:
189 hosts_try_fastopen = :
190 tls_certificate = CERT2
191 tls_privatekey = CERT2
193 tls_verify_certificates = CA1
194 tls_verify_cert_hostnames = *
195 tls_try_verify_hosts = *