1.\" $OpenBSD: SSL_CTX_get0_certificate.3,v 1.3 2019/06/12 09:36:30 schwarze Exp $
2.\"
3.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 12 2019 $
18.Dt SSL_CTX_GET0_CERTIFICATE 3
19.Os
20.Sh NAME
21.Nm SSL_CTX_get0_certificate
22.Nd get the active certificate from an SSL context
23.Sh SYNOPSIS
24.Ft X509 *
25.Fo SSL_CTX_get0_certificate
26.Fa "const SSL_CTX *ctx"
27.Fc
28.Sh DESCRIPTION
29The
30.Fn SSL_CTX_get0_certificate
31function returns an internal pointer
32to the ASN.1 certificate currently active in
33.Fa ctx
34or
35.Dv NULL
36if none was installed with
37.Xr SSL_CTX_use_certificate 3
38or similar functions.
39.Pp
40The returned pointer must not be freed by the caller.
41.Sh SEE ALSO
42.Xr ssl 3 ,
43.Xr SSL_CTX_new 3 ,
44.Xr SSL_CTX_use_certificate 3 ,
45.Xr X509_get_pubkey 3 ,
46.Xr X509_get_subject_name 3 ,
47.Xr X509_new 3
48.Sh HISTORY
49.Fn SSL_CTX_get0_certificate
50first appeared in OpenSSL 1.0.2 and have been available since
51.Ox 6.3 .
52