1 # Exim test configuration 2112
2 # TLS client: verify certificate from server - 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 -----
22 acl_smtp_rcpt = accept
24 log_selector = +tls_peerdn+tls_certificate_verified +received_recipients
29 tls_advertise_hosts = *
31 # Set certificate only if server
33 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
34 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
37 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
46 condition = ${if eq {SERVER}{server}{yes}{no}}
53 transport = send_to_server_failcert
60 transport = send_to_server_retry
66 transport = send_to_server_crypt
72 transport = send_to_server_req_fail
78 transport = send_to_server_req_failname
84 transport = send_to_server_req_passname
87 # ----- Transports -----
91 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
92 send_to_server_failcert:
97 hosts_try_fastopen = :
98 hosts_require_tls = HOSTIPV4
99 tls_certificate = CERT2
100 tls_privatekey = CERT2
102 tls_verify_certificates = CA2
103 tls_try_verify_hosts =
104 tls_verify_cert_hostnames =
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
114 tls_certificate = CERT2
115 tls_privatekey = CERT2
117 tls_verify_certificates = \
118 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
119 tls_try_verify_hosts =
120 tls_verify_cert_hostnames =
122 # this will fail to verify the cert but continue unverified though crypted
123 send_to_server_crypt:
128 hosts_try_fastopen = :
129 hosts_require_tls = HOSTIPV4
130 tls_certificate = CERT2
131 tls_privatekey = CERT2
133 tls_verify_certificates = CA2
134 tls_try_verify_hosts = *
135 tls_verify_cert_hostnames =
137 # this will fail to verify the cert at HOSTIPV4 and fallback to unencrypted
138 send_to_server_req_fail:
143 hosts_try_fastopen = :
144 tls_certificate = CERT2
145 tls_privatekey = CERT2
147 tls_verify_certificates = CA2
149 tls_verify_cert_hostnames =
151 # this will fail to verify the cert name and fallback to unencrypted
152 send_to_server_req_failname:
157 hosts_try_fastopen = :
158 tls_certificate = CERT2
159 tls_privatekey = CERT2
161 tls_verify_certificates = CA1
162 tls_verify_cert_hostnames = server1.example.net : server1.example.org
165 # this will pass the cert verify including name check
166 send_to_server_req_passname:
171 hosts_try_fastopen = :
172 tls_certificate = CERT2
173 tls_privatekey = CERT2
175 tls_verify_certificates = CA1
176 tls_verify_cert_hostnames = noway.example.com : server1.example.com