1 # Exim test configuration 2133
2 # TLS client: verify certificate from server - name-fails
7 host_lookup_order = bydns
8 primary_hostname = myhost.test.ex
9 spool_directory = DIR/spool
10 log_file_path = DIR/spool/log/SERVER%slog
12 gecos_name = CALLER_NAME
15 S1 = FX/exim-ca/example.com/server1.example.com
18 CERT1 = S1/server1.example.com.pem
19 KEY1 = S1/server1.example.com.unlocked.key
24 # ----- Main settings -----
28 acl_smtp_rcpt = accept
30 log_selector = +tls_peerdn+tls_certificate_verified
35 tls_advertise_hosts = *
37 # Set certificate only if server
39 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
40 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
43 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
52 condition = ${if eq {SERVER}{server}{yes}{no}}
59 transport = send_to_server_failcert
66 transport = send_to_server_retry
72 transport = send_to_server_crypt
78 transport = send_to_server_req_fail
84 transport = send_to_server_req_failname
90 transport = send_to_server_req_passname
96 transport = send_to_server_req_failcarryon
99 # ----- Transports -----
103 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
104 send_to_server_failcert:
108 hosts_require_tls = HOSTIPV4
110 tls_certificate = CERT2
111 tls_privatekey = CERT2
113 tls_verify_certificates = CA2
115 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
116 send_to_server_retry:
119 hosts = HOSTIPV4 : 127.0.0.1
120 hosts_require_tls = HOSTIPV4
122 tls_certificate = CERT2
123 tls_privatekey = CERT2
125 tls_verify_certificates = \
126 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
128 # this will fail to verify the cert but continue unverified though crypted
129 send_to_server_crypt:
133 hosts_require_tls = HOSTIPV4
135 tls_certificate = CERT2
136 tls_privatekey = CERT2
138 tls_verify_certificates = CA2
139 tls_try_verify_hosts = *
141 # this will fail to verify the cert at HOSTNAME and fallback to unencrypted
142 # Fail due to lack of correct CA
143 send_to_server_req_fail:
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 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 tls_certificate = CERT2
176 tls_privatekey = CERT2
178 tls_verify_certificates = CA1
179 tls_verify_cert_hostnames = *
182 send_to_server_req_failcarryon:
187 tls_certificate = CERT2
188 tls_privatekey = CERT2
190 tls_verify_certificates = CA1
191 tls_verify_cert_hostnames = *
192 tls_try_verify_hosts = *