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 -----
26 acl_smtp_rcpt = accept
28 log_selector = +tls_peerdn+tls_certificate_verified
33 tls_advertise_hosts = *
35 # Set certificate only if server
37 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
38 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
41 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
50 condition = ${if eq {SERVER}{server}{yes}{no}}
57 transport = send_to_server_failcert
64 transport = send_to_server_retry
70 transport = send_to_server_crypt
76 transport = send_to_server_req_fail
82 transport = send_to_server_req_failname
88 transport = send_to_server_req_passname
94 transport = send_to_server_req_failcarryon
97 # ----- Transports -----
101 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
102 send_to_server_failcert:
106 hosts_require_tls = HOSTIPV4
108 tls_certificate = CERT2
109 tls_privatekey = CERT2
111 tls_verify_certificates = CA2
113 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
114 send_to_server_retry:
117 hosts = HOSTIPV4 : 127.0.0.1
118 hosts_require_tls = HOSTIPV4
120 tls_certificate = CERT2
121 tls_privatekey = CERT2
123 tls_verify_certificates = \
124 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
126 # this will fail to verify the cert but continue unverified though crypted
127 send_to_server_crypt:
131 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 tls_certificate = CERT2
147 tls_privatekey = CERT2
149 tls_verify_certificates = CA2
152 # this will fail to verify the cert name and fallback to unencrypted
153 # fail because the cert is "server1.example.com" and the test system is something else
154 send_to_server_req_failname:
159 tls_certificate = CERT2
160 tls_privatekey = CERT2
162 tls_verify_certificates = CA1
163 tls_verify_cert_hostnames = *
166 # this will pass the cert verify including name check
167 # our stunt DNS has an A record for server1.example.com -> HOSTIPV4
168 send_to_server_req_passname:
171 hosts = server1.example.com
173 tls_certificate = CERT2
174 tls_privatekey = CERT2
176 tls_verify_certificates = CA1
177 tls_verify_cert_hostnames = *
180 send_to_server_req_failcarryon:
185 tls_certificate = CERT2
186 tls_privatekey = CERT2
188 tls_verify_certificates = CA1
189 tls_verify_cert_hostnames = *
190 tls_try_verify_hosts = *