168651Skris=pod 268651Skris 368651Skris=head1 NAME 468651Skris 568651SkrisSSL_get_peer_cert_chain - get the X509 certificate chain of the peer 668651Skris 768651Skris=head1 SYNOPSIS 868651Skris 968651Skris #include <openssl/ssl.h> 1068651Skris 11267256Sjkim STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl); 1268651Skris 1368651Skris=head1 DESCRIPTION 1468651Skris 15267256SjkimSSL_get_peer_cert_chain() returns a pointer to STACK_OF(X509) certificates 1668651Skrisforming the certificate chain of the peer. If called on the client side, 1768651Skristhe stack also contains the peer's certificate; if called on the server 1876866Skrisside, the peer's certificate must be obtained separately using 1968651SkrisL<SSL_get_peer_certificate(3)|SSL_get_peer_certificate(3)>. 2068651SkrisIf the peer did not present a certificate, NULL is returned. 2168651Skris 2268651Skris=head1 NOTES 2368651Skris 2468651SkrisThe peer certificate chain is not necessarily available after reusing 2568651Skrisa session, in which case a NULL pointer is returned. 2668651Skris 27267256SjkimThe reference count of the STACK_OF(X509) object is not incremented. 2868651SkrisIf the corresponding session is freed, the pointer must not be used 2968651Skrisany longer. 3068651Skris 3168651Skris=head1 RETURN VALUES 3268651Skris 3368651SkrisThe following return values can occur: 3468651Skris 3568651Skris=over 4 3668651Skris 3768651Skris=item NULL 3868651Skris 3968651SkrisNo certificate was presented by the peer or no connection was established 4068651Skrisor the certificate chain is no longer available when a session is reused. 4168651Skris 42267256Sjkim=item Pointer to a STACK_OF(X509) 4368651Skris 4468651SkrisThe return value points to the certificate chain presented by the peer. 4568651Skris 4668651Skris=back 4768651Skris 4868651Skris=head1 SEE ALSO 4968651Skris 5068651SkrisL<ssl(3)|ssl(3)>, L<SSL_get_peer_certificate(3)|SSL_get_peer_certificate(3)> 5168651Skris 5268651Skris=cut 53