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:
104 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
116 hosts_require_tls = HOSTIPV4
118 tls_certificate = CERT2
119 tls_privatekey = CERT2
121 tls_verify_certificates = \
122 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
124 # this will fail to verify the cert but continue unverified though crypted
125 send_to_server_crypt:
129 hosts_require_tls = HOSTIPV4
131 tls_certificate = CERT2
132 tls_privatekey = CERT2
134 tls_verify_certificates = CA2
135 tls_try_verify_hosts = *
137 # this will fail to verify the cert at HOSTNAME and fallback to unencrypted
138 # Fail due to lack of correct CA
139 send_to_server_req_fail:
144 tls_certificate = CERT2
145 tls_privatekey = CERT2
147 tls_verify_certificates = CA2
150 # this will fail to verify the cert name and fallback to unencrypted
151 # fail because the cert is "server1.example.com" and the test system is something else
152 send_to_server_req_failname:
157 tls_certificate = CERT2
158 tls_privatekey = CERT2
160 tls_verify_certificates = CA1
161 tls_verify_cert_hostnames = *
164 # this will pass the cert verify including name check
165 # our stunt DNS has an A record for server1.example.com -> HOSTIPV4
166 send_to_server_req_passname:
169 hosts = server1.example.com
171 tls_certificate = CERT2
172 tls_privatekey = CERT2
174 tls_verify_certificates = CA1
175 tls_verify_cert_hostnames = *
178 send_to_server_req_failcarryon:
183 tls_certificate = CERT2
184 tls_privatekey = CERT2
186 tls_verify_certificates = CA1
187 tls_verify_cert_hostnames = *
188 tls_try_verify_hosts = *