5 SSL_get_peer_cert_chain - get the X509 certificate chain of the peer
9 #include <openssl/ssl.h>
11 STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl);
15 SSL_get_peer_cert_chain() returns a pointer to STACK_OF(X509) certificates
16 forming the certificate chain of the peer. If called on the client side,
17 the stack also contains the peer's certificate; if called on the server
18 side, the peer's certificate must be obtained separately using
19 L<SSL_get_peer_certificate(3)|SSL_get_peer_certificate(3)>.
20 If the peer did not present a certificate, NULL is returned.
24 The peer certificate chain is not necessarily available after reusing
25 a session, in which case a NULL pointer is returned.
27 The reference count of the STACK_OF(X509) object is not incremented.
28 If the corresponding session is freed, the pointer must not be used
33 The following return values can occur:
39 No certificate was presented by the peer or no connection was established
40 or the certificate chain is no longer available when a session is reused.
42 =item Pointer to a STACK_OF(X509)
44 The return value points to the certificate chain presented by the peer.
50 L<ssl(3)|ssl(3)>, L<SSL_get_peer_certificate(3)|SSL_get_peer_certificate(3)>