1 # Exim test configuration 1162
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:
104 hosts_try_fastopen = :
105 hosts_require_tls = HOSTIPV4
106 tls_certificate = CERT2
107 tls_privatekey = CERT2
109 tls_verify_certificates = CA2
111 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
112 send_to_server_retry:
115 hosts = HOSTIPV4 : 127.0.0.1
117 hosts_try_fastopen = :
118 hosts_require_tls = HOSTIPV4
119 tls_certificate = CERT2
120 tls_privatekey = CERT2
122 tls_verify_certificates = \
123 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
125 # this will fail to verify the cert but continue unverified though crypted
126 send_to_server_crypt:
131 hosts_try_fastopen = :
132 hosts_require_tls = HOSTIPV4
133 tls_certificate = CERT2
134 tls_privatekey = CERT2
136 tls_verify_certificates = CA2
137 tls_try_verify_hosts = *
139 # this will fail to verify the cert at HOSTNAME and fallback to unencrypted
140 # Fail due to lack of correct CA
141 send_to_server_req_fail:
146 hosts_try_fastopen = :
147 tls_certificate = CERT2
148 tls_privatekey = CERT2
150 tls_verify_certificates = CA2
153 # this will fail to verify the cert name and fallback to unencrypted
154 # fail because the cert is "server1.example.com" and the test system is something else
155 send_to_server_req_failname:
160 hosts_try_fastopen = :
161 tls_certificate = CERT2
162 tls_privatekey = CERT2
164 tls_verify_certificates = CA1
165 tls_verify_cert_hostnames = *
168 # this will pass the cert verify including name check
169 # our stunt DNS has an A record for server1.example.com -> HOSTIPV4
170 send_to_server_req_passname:
173 hosts = server1.example.com
175 hosts_try_fastopen = :
176 tls_certificate = CERT2
177 tls_privatekey = CERT2
179 tls_verify_certificates = CA1
180 tls_verify_cert_hostnames = *
183 # this will fail to verify the cert name but carry on (try-verify mode)
184 # fail because the cert is "server1.example.com" and the test system is something else
185 send_to_server_req_failcarryon:
190 hosts_try_fastopen = :
191 tls_certificate = CERT2
192 tls_privatekey = CERT2
194 tls_verify_certificates = CA1
195 tls_verify_cert_hostnames = *
196 tls_try_verify_hosts = *