Hua Wu wrote:
> 
> Hi, there,
> 
> I am new in SSL and have a problem on verifying a self-signed certificate.
> 
> I am working on client side. When verify a self-signed certificate, I
> suppose
> to get the verify_result =  X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT.
> But actually, I received X509_V_ERR_INVALID_PURPOSE.
> 
> I debugged in verify_callback and observed three continue entries. The
> ctx->error
> of the fist entry was X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT.
> But it was changed immediately to X509_V_ERR_INVALID_PURPOSE in the
> 2nd and 3rd entries.
> 
> The question is
> 
> 1. How can I keep X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT as
> the final error which is what I expected and may be used later?
> 
> 2. Why the error became invalid purpose? I didn't set purpose in my SSL
> session.
> So SSL should select its default (X509_PURPOSE_SSL_SERVER).
> 

There is a bug in the SSL server verification purpose code which is
fixed in the latest development version. That might be it, to check try
using crypto\x509v3\v3_purp.c from the latest snapshot.

Also 0.9.5a verify has an additional feature not in previous versions of
OpenSSL. Previous versions would give the error
X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT for any self signed certificate
now the verify will succeed if the self signed certificate is included
in the trusted store.

If none of that helps why don't you include the certificate that gives
the error?

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to