Project

General

Profile

Requirements for certificates used with Windows 7 » History » Version 10

Tobias Brunner, 26.08.2014 16:50

1 1 Martin Willi
h1. Requirements for certificates used with Windows 7
2 1 Martin Willi
3 7 Tobias Brunner
The Windows 7 Beta release was liberal in accepting certificates, but already the Release Candidate added several new requirements for the VPN gateway certificate.
4 1 Martin Willi
5 1 Martin Willi
h2. Required fields
6 1 Martin Willi
7 3 Andreas Steffen
Your gateway certificate must have:
8 5 Andreas Steffen
9 9 Tobias Brunner
# An *Extended Key Usage* flag explicitly allowing the certificate to be used for authentication purposes. The *serverAuth* EKU having the OID _1.3.6.1.5.5.7.3.1_ (often called _TLS Web server authentication_) will do that. If you are using OpenSSL to generate your certificates then include the option
10 1 Martin Willi
  <pre>
11 1 Martin Willi
extendedKeyUsage = serverAuth
12 7 Tobias Brunner
</pre>
13 1 Martin Willi
14 7 Tobias Brunner
  For the [[IpsecPkiIssue|ipsec pki]] tool add the following argument
15 7 Tobias Brunner
  <pre>
16 7 Tobias Brunner
--flag serverAuth
17 7 Tobias Brunner
</pre>
18 1 Martin Willi
19 7 Tobias Brunner
  In addition to _serverAuth_ the "IP Security IKE Intermediate" EKU with OID _1.3.6.1.5.5.8.2.2_ does not hurt either and will allow you to use the certificate with older [[IOS_(Apple)|Mac OS X releases]] too.
20 7 Tobias Brunner
  So, this will work too:
21 7 Tobias Brunner
22 7 Tobias Brunner
  <pre>
23 7 Tobias Brunner
extendedKeyUsage = serverAuth, 1.3.6.1.5.5.8.2.2
24 7 Tobias Brunner
</pre><pre>
25 7 Tobias Brunner
--flag serverAuth --flag ikeIntermediate
26 7 Tobias Brunner
</pre>
27 9 Tobias Brunner
# The hostname of the VPN gateway entered in the clients connection properties *MUST* be contained either in the *subjectDistinguishedName* of the server certificate
28 1 Martin Willi
29 4 Andreas Steffen
  <pre>
30 4 Andreas Steffen
C=CH, O=strongSwan Project, CN=vpn.strongswan.org
31 4 Andreas Steffen
</pre>
32 1 Martin Willi
33 8 Tobias Brunner
  and/or in a *subjectAltName* extension that can be added with the OpenSSL option
34 1 Martin Willi
35 1 Martin Willi
  <pre>
36 1 Martin Willi
subjectAltName = DNS:vpn.strongswan.org
37 1 Martin Willi
</pre>
38 1 Martin Willi
39 7 Tobias Brunner
  or the [[IpsecPkiIssue|ipsec pki issue]] argument
40 7 Tobias Brunner
41 7 Tobias Brunner
  <pre>
42 7 Tobias Brunner
--san vpn.strongswan.org
43 7 Tobias Brunner
</pre>
44 7 Tobias Brunner
45 8 Tobias Brunner
  *For optimal interoperability* with other client implementations it is recommended to include the hostname as *subjectAltName*, because matching only parts of the distinguished name is actually not compliant with "RFC 4945":http://tools.ietf.org/html/rfc4945. Having the hostname encoded as *subjectAltName* is essential when using [[AndroidVpnClient|our Android app]] or working with [[IOS_(Apple)|Mac OS X clients]].
46 7 Tobias Brunner
47 10 Tobias Brunner
h2. Client certificates
48 10 Tobias Brunner
49 10 Tobias Brunner
When using client certificates you may come across _Error 13806_. This happens if Windows does not find a suitable client certificate. Besides the certificate being installed in the wrong location or problems with the CA certificate, this could be due to the properties of the certificate itself. The following table lists combinations of CN (the rest of the DN does not matter), SAN and EKU that work:
50 10 Tobias Brunner
51 10 Tobias Brunner
|_<. CN                     |_<. SAN                       |_<. EKU          |_<. Comments|
52 10 Tobias Brunner
|\4(level2). Usable as user and machine certificates|
53 10 Tobias Brunner
|CN="user"
54 10 Tobias Brunner
CN="user@example.com"
55 10 Tobias Brunner
CN="host.example.com"       |matching SAN                  |none             ||
56 10 Tobias Brunner
|CN="user"
57 10 Tobias Brunner
CN="user@example.com"
58 10 Tobias Brunner
CN="host.example.com"       |matching SAN                  | _clientAuth_... |If any EKU are specified, make sure _clientAuth_ is contained|
59 10 Tobias Brunner
|\4(level2). Only usable as machine certificates|
60 10 Tobias Brunner
|\4(level3). When using user certificates Windows will not send the subject DN as client identity, but the CN instead (e.g. "user" for the first one). If no matching SAN is contained in the certificate strongSwan will reject it because it can't confirm the client identity.|
61 10 Tobias Brunner
|CN="user"
62 10 Tobias Brunner
CN="host@example.com"
63 10 Tobias Brunner
CN="host.example.com"       |none or not matching          |none             ||
64 10 Tobias Brunner
|CN="user"
65 10 Tobias Brunner
CN="host@example.com"
66 10 Tobias Brunner
CN="host.example.com"       |does not matter               | _serverAuth_    |Even if a matching SAN is contained and strongSwan would accept it, Windows will ignore it for user authentication due to the missing _clientAuth_ EKU|
67 10 Tobias Brunner
68 10 Tobias Brunner
69 10 Tobias Brunner
70 1 Martin Willi
h2. Disabling extended certificate checks
71 1 Martin Willi
72 1 Martin Willi
Alternatively, you may disable these extended certificate checks on the client. 
73 1 Martin Willi
74 1 Martin Willi
> *This is potentially dangerous, as any certificate holder assured by your CA may act as the VPN gateway.*
75 1 Martin Willi
76 4 Andreas Steffen
To disable the extended checks, add a _DWORD_ called *DisableIKENameEkuCheck* to
77 1 Martin Willi
78 4 Andreas Steffen
<pre>
79 4 Andreas Steffen
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\RasMan\Parameters\
80 4 Andreas Steffen
</pre>
81 1 Martin Willi
82 1 Martin Willi
in the client's registry.
83 4 Andreas Steffen
84 4 Andreas Steffen
85 4 Andreas Steffen
h2. Further information
86 4 Andreas Steffen
87 4 Andreas Steffen
For more details about the requirements and other ways to disable the certificate checks, have a look to "this knowledge base article":http://support.microsoft.com/kb/926182.
88 7 Tobias Brunner
89 7 Tobias Brunner
"This blog entry":http://www.carbonwind.net/blog/post/VPN-Reconnect-in-Windows-7-RC-redux.aspx also provides detailed information about the Windows 7 certificate requirements.