Use TLS by default on callouts/cutthroughs
[users/jgh/exim.git] / test / confs / 2112
1 # Exim test configuration 2112
2 # TLS client: verify certificate from server - fails
3
4 SERVER=
5
6 exim_path = EXIM_PATH
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
11 gecos_pattern = ""
12 gecos_name = CALLER_NAME
13
14 FX = DIR/aux-fixed
15 S1 = FX/exim-ca/example.com/server1.example.com
16
17 CA1 =   S1/ca_chain.pem 
18 CERT1 = S1/server1.example.com.pem
19 KEY1 =  S1/server1.example.com.unlocked.key
20 CA2 =   FX/cert2
21 CERT2 = FX/cert2
22 KEY2 =  FX/cert2
23
24 # ----- Main settings -----
25
26 acl_smtp_rcpt = accept
27
28 log_selector =  +tls_peerdn+tls_certificate_verified
29
30 queue_only
31 queue_run_in_order
32
33 tls_advertise_hosts = *
34
35 # Set certificate only if server
36
37 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
38 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
39
40 tls_verify_hosts = *
41 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
42
43
44 # ----- Routers -----
45
46 begin routers
47
48 server_dump:
49   driver = redirect
50   condition = ${if eq {SERVER}{server}{yes}{no}}
51   data = :blackhole:
52
53 client_x:
54   driver = accept
55   local_parts = userx
56   retry_use_local_part
57   transport = send_to_server_failcert
58   errors_to = ""
59
60 client_y:
61   driver = accept
62   local_parts = usery
63   retry_use_local_part
64   transport = send_to_server_retry
65
66 client_z:
67   driver = accept
68   local_parts = userz
69   retry_use_local_part
70   transport = send_to_server_crypt
71
72 client_q:
73   driver = accept
74   local_parts = userq
75   retry_use_local_part
76   transport = send_to_server_req_fail
77
78 client_r:
79   driver = accept
80   local_parts = userr
81   retry_use_local_part
82   transport = send_to_server_req_failname
83
84 client_s:
85   driver = accept
86   local_parts = users
87   retry_use_local_part
88   transport = send_to_server_req_passname
89
90
91 # ----- Transports -----
92
93 begin transports
94
95 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
96 send_to_server_failcert:
97   driver = smtp
98   allow_localhost
99   hosts = HOSTIPV4
100   hosts_require_tls = HOSTIPV4
101   port = PORT_D
102   tls_certificate = CERT2
103   tls_privatekey = CERT2
104
105   tls_verify_certificates = CA2
106   tls_try_verify_hosts =
107   tls_verify_cert_hostnames =
108
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:
111   driver = smtp
112   allow_localhost
113   hosts = HOSTIPV4 : 127.0.0.1
114   hosts_require_tls = HOSTIPV4
115   port = PORT_D
116   tls_certificate = CERT2
117   tls_privatekey = CERT2
118
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 =
123
124 # this will fail to verify the cert but continue unverified though crypted
125 send_to_server_crypt:
126   driver = smtp
127   allow_localhost
128   hosts = HOSTIPV4
129   hosts_require_tls = HOSTIPV4
130   port = PORT_D
131   tls_certificate = CERT2
132   tls_privatekey = CERT2
133
134   tls_verify_certificates = CA2
135   tls_try_verify_hosts = *
136   tls_verify_cert_hostnames =
137
138 # this will fail to verify the cert at HOSTIPV4 and fallback to unencrypted
139 send_to_server_req_fail:
140   driver = smtp
141   allow_localhost
142   hosts = HOSTIPV4
143   port = PORT_D
144   tls_certificate = CERT2
145   tls_privatekey = CERT2
146
147   tls_verify_certificates = CA2
148   tls_verify_hosts = *
149   tls_verify_cert_hostnames =
150
151  # this will fail to verify the cert name and fallback to unencrypted
152  send_to_server_req_failname:
153    driver = smtp
154    allow_localhost
155    hosts = HOSTIPV4
156    port = PORT_D
157    tls_certificate = CERT2
158    tls_privatekey = CERT2
159  
160    tls_verify_certificates = CA1
161    tls_verify_cert_hostnames = server1.example.net : server1.example.org
162    tls_verify_hosts = *
163  
164  # this will pass the cert verify including name check
165  send_to_server_req_passname:
166    driver = smtp
167    allow_localhost
168    hosts = HOSTIPV4
169    port = PORT_D
170    tls_certificate = CERT2
171    tls_privatekey = CERT2
172  
173    tls_verify_certificates = CA1
174    tls_verify_cert_hostnames = noway.example.com : server1.example.com
175    tls_verify_hosts = *
176
177 # End