SSL_get_peer_certificate.pod revision 76866
168651Skris=pod
268651Skris
368651Skris=head1 NAME
468651Skris
568651SkrisSSL_get_peer_certificate - get the X509 certificate of the peer
668651Skris
768651Skris=head1 SYNOPSIS
868651Skris
968651Skris #include <openssl/ssl.h>
1068651Skris
1168651Skris X509 *SSL_get_peer_certificate(SSL *ssl);
1268651Skris
1368651Skris=head1 DESCRIPTION
1468651Skris
1568651SkrisSSL_get_peer_certificate() returns a pointer to the X509 certificate the
1668651Skrispeer presented. If the peer did not present a certificate, NULL is returned.
1768651Skris
1868651Skris=head1 NOTES
1968651Skris
2068651SkrisThat a certificate is returned does not indicate information about the
2168651Skrisverification state, use L<SSL_get_verify_result(3)|SSL_get_verify_result(3)>
2268651Skristo check the verification state.
2368651Skris
2468651SkrisThe reference count of the X509 object is incremented by one, so that it
2568651Skriswill not be destroyed when the session containing the peer certificate is
2676866Skrisfreed. The X509 object must be explicitly freed using X509_free().
2768651Skris
2868651Skris=head1 RETURN VALUES
2968651Skris
3068651SkrisThe following return values can occur:
3168651Skris
3268651Skris=over 4
3368651Skris
3468651Skris=item NULL
3568651Skris
3668651SkrisNo certificate was presented by the peer or no connection was established.
3768651Skris
3868651Skris=item Pointer to an X509 certificate
3968651Skris
4068651SkrisThe return value points to the certificate presented by the peer.
4168651Skris
4268651Skris=back
4368651Skris
4468651Skris=head1 SEE ALSO
4568651Skris
4668651SkrisL<ssl(3)|ssl(3)>, L<SSL_get_verify_result(3)|SSL_get_verify_result(3)>
4768651Skris
4868651Skris=cut
49