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:
96 hosts_require_tls = HOSTIPV4
98 tls_certificate = CERT2
99 tls_privatekey = CERT2
101 tls_verify_certificates = CA2
102 tls_try_verify_hosts =
103 tls_verify_cert_hostnames =
105 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
106 send_to_server_retry:
109 hosts = HOSTIPV4 : 127.0.0.1
110 hosts_require_tls = HOSTIPV4
112 tls_certificate = CERT2
113 tls_privatekey = CERT2
115 tls_verify_certificates = \
116 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
117 tls_try_verify_hosts =
118 tls_verify_cert_hostnames =
120 # this will fail to verify the cert but continue unverified though crypted
121 send_to_server_crypt:
125 hosts_require_tls = HOSTIPV4
127 tls_certificate = CERT2
128 tls_privatekey = CERT2
130 tls_verify_certificates = CA2
131 tls_try_verify_hosts = *
132 tls_verify_cert_hostnames =
134 # this will fail to verify the cert at HOSTIPV4 and fallback to unencrypted
135 send_to_server_req_fail:
140 tls_certificate = CERT2
141 tls_privatekey = CERT2
143 tls_verify_certificates = CA2
145 tls_verify_cert_hostnames =
147 # this will fail to verify the cert name and fallback to unencrypted
148 send_to_server_req_failname:
153 tls_certificate = CERT2
154 tls_privatekey = CERT2
156 tls_verify_certificates = CA1
157 tls_verify_cert_hostnames = server1.example.net : server1.example.org
160 # this will pass the cert verify including name check
161 send_to_server_req_passname:
166 tls_certificate = CERT2
167 tls_privatekey = CERT2
169 tls_verify_certificates = CA1
170 tls_verify_cert_hostnames = noway.example.com : server1.example.com