1SSL_get_peer_certificate(3)         OpenSSL        SSL_get_peer_certificate(3)
2
3
4

NAME

6       SSL_get_peer_certificate - get the X509 certificate of the peer
7

SYNOPSIS

9        #include <openssl/ssl.h>
10
11        X509 *SSL_get_peer_certificate(const SSL *ssl);
12

DESCRIPTION

14       SSL_get_peer_certificate() returns a pointer to the X509 certificate
15       the peer presented. If the peer did not present a certificate, NULL is
16       returned.
17

NOTES

19       Due to the protocol definition, a TLS/SSL server will always send a
20       certificate, if present. A client will only send a certificate when
21       explicitly requested to do so by the server (see
22       SSL_CTX_set_verify(3)). If an anonymous cipher is used, no certificates
23       are sent.
24
25       That a certificate is returned does not indicate information about the
26       verification state, use SSL_get_verify_result(3) to check the
27       verification state.
28
29       The reference count of the X509 object is incremented by one, so that
30       it will not be destroyed when the session containing the peer
31       certificate is freed. The X509 object must be explicitly freed using
32       X509_free().
33

RETURN VALUES

35       The following return values can occur:
36
37       NULL
38           No certificate was presented by the peer or no connection was
39           established.
40
41       Pointer to an X509 certificate
42           The return value points to the certificate presented by the peer.
43

SEE ALSO

45       ssl(3), SSL_get_verify_result(3), SSL_CTX_set_verify(3)
46
47
48
491.0.2k                            2017-01-26       SSL_get_peer_certificate(3)
Impressum