SSL_get_peer_cert_chain 3 2005-04-23 0.9.9-dev OpenSSL
NAME
SSL_get_peer_cert_chain - get the X509 certificate chain of the peer
LIBRARY
libcrypto, -lcrypto
SYNOPSIS
#include
STACKOF(X509) *SSL_get_peer_cert_chain(const SSL *ssl);
DESCRIPTION
_S_S_L___g_e_t___p_e_e_r___c_e_r_t___c_h_a_i_n_(_) returns a pointer to STACKOF(X509) certificates
forming the certificate chain of the peer. If called on the client side,
the stack also contains the peer's certificate; if called on the server
side, the peer's certificate must be obtained separately using
_S_S_L___g_e_t___p_e_e_r___c_e_r_t_i_f_i_c_a_t_e(3).
If the peer did not present a certificate, NULL is returned.
NOTES
The peer certificate chain is not necessarily available after reusing
a session, in which case a NULL pointer is returned.
The reference count of the STACKOF(X509) object is not incremented.
If the corresponding session is freed, the pointer must not be used
any longer.
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.
-
SEE ALSO
_s_s_l(3), _S_S_L___g_e_t___p_e_e_r___c_e_r_t_i_f_i_c_a_t_e(3)