Blob Blame History Raw
'\" t
.\"     Title: ne_ssl_trust_cert
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 30 September 2016
.\"    Manual: neon API reference
.\"    Source: neon 0.30.2
.\"  Language: English
.\"
.TH "NE_SSL_TRUST_CERT" "3" "30 September 2016" "neon 0.30.2" "neon API reference"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ne_ssl_trust_cert, ne_ssl_trust_default_ca \- functions to indicate that certificates are trusted
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <ne_session\&.h>
.fi
.ft
.HP \w'void\ ne_ssl_trust_cert('u
.BI "void ne_ssl_trust_cert(ne_session\ *" "session" ", const\ ne_ssl_certificate\ *" "cert" ");"
.HP \w'void\ ne_ssl_trust_default_ca('u
.BI "void ne_ssl_trust_default_ca(ne_session\ *" "session" ");"
.SH "DESCRIPTION"
.PP
To indicate that a given certificate is trusted by the user, the certificate object can be passed to
\fBne_ssl_trust_cert\fR\&. The certificate object is duplicated internally and can subsequently be destroyed\&.
.PP
The SSL library in use by neon may include a default set of CA certificates; calling the
\fBne_ssl_trust_default_ca\fR
function will indicate that these CAs are trusted by the user\&.
.SH "EXAMPLES"
.PP
Load the CA certificate stored in
/path/to/cacert\&.pem:
.sp
.if n \{\
.RS 4
.\}
.nf
ne_session *sess = ne_session_create(\&.\&.\&.);
ne_ssl_certificate *cert = ne_ssl_cert_read("/path/to/cacert\&.pem");

if (cert) {
   ne_ssl_trust_cert(sess, cert);
   ne_ssl_cert_free(cert);
} else {
   printf("Could not load CA cert: %s\en", ne_get_error(sess));
}
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.PP
ne_ssl_cert_read,
ne_ssl_cert_import,
ne_ssl_cert_free
.SH "AUTHOR"
.PP
\fBJoe Orton\fR <\&neon@lists.manyfish.co.uk\&>
.RS 4
Author.
.RE
.SH "COPYRIGHT"
.br