summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/doc/ssl/SSL_get_peer_certificate.3
diff options
context:
space:
mode:
authorbentley <bentley@openbsd.org>2014-10-12 09:33:03 +0000
committerbentley <bentley@openbsd.org>2014-10-12 09:33:03 +0000
commit709d8cd0fe4332147f808dafbb149a4bf76a0e56 (patch)
treeb2433e032090fcfcf4c9645e388fdfd0b47eb254 /lib/libssl/src/doc/ssl/SSL_get_peer_certificate.3
parentLogitech Webcam C310 just works with uvideo(4), add it (diff)
downloadwireguard-openbsd-709d8cd0fe4332147f808dafbb149a4bf76a0e56.tar.xz
wireguard-openbsd-709d8cd0fe4332147f808dafbb149a4bf76a0e56.zip
Convert libssl manpages from pod to mdoc(7).
libcrypto has not been started yet. ok schwarze@ miod@
Diffstat (limited to 'lib/libssl/src/doc/ssl/SSL_get_peer_certificate.3')
-rw-r--r--lib/libssl/src/doc/ssl/SSL_get_peer_certificate.350
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/libssl/src/doc/ssl/SSL_get_peer_certificate.3 b/lib/libssl/src/doc/ssl/SSL_get_peer_certificate.3
new file mode 100644
index 00000000000..7e4ab3fccfa
--- /dev/null
+++ b/lib/libssl/src/doc/ssl/SSL_get_peer_certificate.3
@@ -0,0 +1,50 @@
+.Dd $Mdocdate: October 12 2014 $
+.Dt SSL_GET_PEER_CERTIFICATE 3
+.Os
+.Sh NAME
+.Nm SSL_get_peer_certificate
+.Nd get the X509 certificate of the peer
+.Sh SYNOPSIS
+.In openssl/ssl.h
+.Ft X509 *
+.Fn SSL_get_peer_certificate "const SSL *ssl"
+.Sh DESCRIPTION
+.Fn SSL_get_peer_certificate
+returns a pointer to the X509 certificate the peer presented.
+If the peer did not present a certificate,
+.Dv NULL
+is returned.
+.Sh NOTES
+Due to the protocol definition, a TLS/SSL server will always send a
+certificate, if present.
+A client will only send a certificate when explicitly requested to do so by the
+server (see
+.Xr SSL_CTX_set_verify 3 ) .
+If an anonymous cipher is used, no certificates are sent.
+.Pp
+That a certificate is returned does not indicate information about the
+verification state.
+Use
+.Xr SSL_get_verify_result 3
+to check the verification state.
+.Pp
+The reference count of the
+.Vt X509
+object is incremented by one, so that it will not be destroyed when the session
+containing the peer certificate is freed.
+The
+.Vt X509
+object must be explicitly freed using
+.Xr X509_free 3 .
+.Sh RETURN VALUES
+The following return values can occur:
+.Bl -tag -width Ds
+.It Dv NULL
+No certificate was presented by the peer or no connection was established.
+.It Pointer to an X509 certificate
+The return value points to the certificate presented by the peer.
+.El
+.Sh SEE ALSO
+.Xr ssl 3 ,
+.Xr SSL_CTX_set_verify 3 ,
+.Xr SSL_get_verify_result 3