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