refsslca.html   [plain text]


<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_ssl_trust_cert</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refssldname.html" title="ne_ssl_dname"><link rel="next" href="refsslvfy.html" title="ne_ssl_set_verify"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_ssl_trust_cert</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refssldname.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refsslvfy.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refsslca"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_ssl_trust_cert, ne_ssl_trust_default_ca — functions to indicate that certificates are trusted</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;ne_session.h&gt;</pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_ssl_trust_cert</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, const ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_ssl_trust_default_ca</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id319874"></a><h2>Description</h2><p>To indicate that a given certificate is trusted by the
user, the certificate object can be passed to
<code class="function">ne_ssl_trust_cert</code>.  The certificate object is
duplicated internally and can subsequently be destroyed.</p><p>The SSL library in use by neon may include a default
set of CA certificates; calling the
<code class="function">ne_ssl_trust_default_ca</code> function will indicate
that these CAs are trusted by the user.</p></div><div class="refsect1" lang="en"><a name="id319902"></a><h2>Examples</h2><p>Load the CA certificate stored in <code class="filename">/path/to/cacert.pem</code>:</p><pre class="programlisting">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\n", ne_get_error(sess));
}</pre></div><div class="refsect1" lang="en"><a name="id319926"></a><h2>See also</h2><p><a href="refsslcertio.html#ne_ssl_cert_read">ne_ssl_cert_read</a>, <a href="refsslcertio.html#ne_ssl_cert_import">ne_ssl_cert_import</a>, <a href="refsslcert2.html#ne_ssl_cert_free">ne_ssl_cert_free</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refssldname.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refsslvfy.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_ssl_dname </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_ssl_set_verify</td></tr></table></div></body></html>