2012/2/16 Iñaki Baz Castillo <[email protected]>:
> As far as I see, SSL_get_peer_cert_chain(ssl) does never return NULL,
> regardless the client presented a single certificate, a certificate +
> chain of certificates, or no certificate at all. Am I miss something?
> SSL_get_peer_cert(ssl) does return NULL in case of no client's
> certificate.

The doc about SSL_get_peer_cert_chain(ssl) must be wrong, sure:


-------------------
RETURN VALUES

The following return values can occur:

NULL
No certificate was presented by the peer or no connection was
established or the certificate chain is no longer available when a
session is reused.

Pointer to a STACKOF(X509)
The return value points to the certificate chain presented by the peer.
-------------------


That's not true. Regardless there is peer certificate or not, and
regardless there is peer chain of certificates or not, the function
returns a pointer to STACK_OF(X509)  (rather than STACKOF). Then I can
do sk_X509_num(sk) to get the numbers of certs in the chain, which can
be zero.


-- 
Iñaki Baz Castillo
<[email protected]>
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [email protected]

Reply via email to