问题原文
原帖链接 · Koala Yeung · CC BY-SA 3.0
I was following this wiki instruction to generate OpenVPN client certificate. This involves:
easyrsa gen-req client1 nopass
I tried to use this client1 certificate in my OpenVPN setup. The server log show the following logs (note: the IP address changed from public IP to 192.168.0.2 for security reason):
192.168.0.2:5570 TLS: Initial packet from [AF_INET]192.168.0.2:5570, sid=1e71335b cc13ec8f
192.168.0.2:5570 VERIFY ERROR: depth=0, error=unsupported certificate purpose: CN=client1
192.168.0.2:5570 OpenSSL: error:1417C086:SSL routines:tls_process_client_certificate:certificate verify failed
192.168.0.2:5570 TLS_ERROR: BIO read tls_read_plaintext error
192.168.0.2:5570 TLS Error: TLS object -> incoming plaintext read error
192.168.0.2:5570 TLS Error: TLS handshake failed
192.168.0.2:5570 SIGUSR1[soft,tls-error] received, client-instance restarting
So the clear error should be this:
VERIFY ERROR: depth=0, error=unsupported certificate purpose: CN=client1
I checked the certificate with this command:
openssl x509 -in client1.crt -text -noout -purpose
And the Certificate purposes section output looks like this:
Certificate purposes:
SSL client : No
SSL client CA : No
SSL server : Yes
SSL server CA : No
Netscape SSL server : Yes
Netscape SSL server CA : No
S/MIME signing : No
S/MIME signing CA : No
S/MIME encryption : No
S/MIME encryption CA : No
CRL signing : No
CRL signing CA : No
Any Purpose : Yes
Any Purpose CA : Yes
OCSP helper : Yes
OCSP helper CA : No
Time Stamp signing : No
Time Stamp signing CA : No
My Questions:
- What is wrong with my client certificate?
- What should I do to generate the correct certificate?
已采纳解答
原帖链接 · dotvotdot · CC BY-SA 3.0
The correct way to enable nsCertType is via the easyrsa vars file:
# Support deprecated "Netscape" extensions? (choices "yes" or "no".) The default
# is "no" to discourage use of deprecated extensions. If you require this
# feature to use with --ns-cert-type, set this to "yes" here. This support
# should be replaced with the more modern --remote-cert-tls feature. If you do
# not use --ns-cert-type in your configs, it is safe (and recommended) to leave
# this defined to "no". When set to "yes", server-signed certs get the
# nsCertType=server attribute, and also get any NS_COMMENT defined below in the
# nsComment field.
#set_var EASYRSA_NS_SUPPORT "no"
set_var EASYRSA_NS_SUPPORT "yes"
The resulting certificate has the following purpose:
X509v3 Extended Key Usage:
TLS Web Client Authentication
X509v3 Key Usage:
Digital Signature
Netscape Comment:
Easy-RSA Generated Certificate
Netscape Cert Type:
SSL Client
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
