1 # Exim test configuration 2112
2 # TLS client: verify certificate from server - 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 +received_recipients
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
91 # ----- Transports -----
95 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
96 send_to_server_failcert:
100 hosts_require_tls = HOSTIPV4
102 tls_certificate = CERT2
103 tls_privatekey = CERT2
105 tls_verify_certificates = CA2
106 tls_try_verify_hosts =
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_try_verify_hosts =
122 tls_verify_cert_hostnames =
124 # this will fail to verify the cert but continue unverified though crypted
125 send_to_server_crypt:
129 hosts_require_tls = HOSTIPV4
131 tls_certificate = CERT2
132 tls_privatekey = CERT2
134 tls_verify_certificates = CA2
135 tls_try_verify_hosts = *
136 tls_verify_cert_hostnames =
138 # this will fail to verify the cert at HOSTIPV4 and fallback to unencrypted
139 send_to_server_req_fail:
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 tls_certificate = CERT2
158 tls_privatekey = CERT2
160 tls_verify_certificates = CA1
161 tls_verify_cert_hostnames = server1.example.net : server1.example.org
164 # this will pass the cert verify including name check
165 send_to_server_req_passname:
170 tls_certificate = CERT2
171 tls_privatekey = CERT2
173 tls_verify_certificates = CA1
174 tls_verify_cert_hostnames = noway.example.com : server1.example.com