1 # Exim test configuration 2012
2 # TLS client: verify certificate from server - fails
7 host_lookup_order = bydns
8 primary_hostname = myhost.test.ex
9 rfc1413_query_timeout = 0s
10 spool_directory = DIR/spool
11 log_file_path = DIR/spool/log/SERVER%slog
13 gecos_name = CALLER_NAME
16 S1 = FX/exim-ca/example.com/server1.example.com
19 CERT1 = S1/server1.example.com.pem
20 KEY1 = S1/server1.example.com.unlocked.key
25 # ----- Main settings -----
27 acl_smtp_rcpt = accept
29 log_selector = +tls_peerdn+tls_certificate_verified
34 tls_advertise_hosts = *
36 # Set certificate only if server
38 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
39 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
42 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
51 condition = ${if eq {SERVER}{server}{yes}{no}}
58 transport = send_to_server_failcert
65 transport = send_to_server_retry
71 transport = send_to_server_crypt
77 transport = send_to_server_req_fail
83 transport = send_to_server_req_failname
89 transport = send_to_server_req_passname
92 # ----- Transports -----
96 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
97 send_to_server_failcert:
101 hosts_require_tls = HOSTIPV4
103 tls_certificate = CERT2
104 tls_privatekey = CERT2
106 tls_verify_certificates = CA2
107 tls_verify_cert_hostnames =
109 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
110 send_to_server_retry:
113 hosts = HOSTIPV4 : 127.0.0.1
114 hosts_require_tls = HOSTIPV4
116 tls_certificate = CERT2
117 tls_privatekey = CERT2
119 tls_verify_certificates = \
120 ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
121 tls_verify_cert_hostnames =
123 # this will fail to verify the cert but continue unverified though crypted
124 send_to_server_crypt:
128 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 tls_certificate = CERT2
144 tls_privatekey = CERT2
146 tls_verify_certificates = CA2
148 tls_verify_cert_hostnames =
150 # this will fail to verify the cert name and fallback to unencrypted
151 send_to_server_req_failname:
156 tls_certificate = CERT2
157 tls_privatekey = CERT2
159 tls_verify_certificates = CA1
160 tls_verify_cert_hostnames = server1.example.net : server1.example.org
163 # this will pass the cert verify including name check
164 send_to_server_req_passname:
169 tls_certificate = CERT2
170 tls_privatekey = CERT2
172 tls_verify_certificates = CA1
173 tls_verify_cert_hostnames = noway.example.com : server1.example.com