1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_ssl_trust_cert</title><link rel="stylesheet" type="text/css" href="../manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" 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" title="ne_ssl_trust_cert"><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" title="Synopsis"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;ne_session.h&gt;</pre><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">ne_ssl_trust_cert</b>(</code></td><td>ne_session *<var class="pdparam">session</var>, </td></tr><tr><td> </td><td>const ne_ssl_certificate *<var class="pdparam">cert</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">ne_ssl_trust_default_ca</b>(</code></td><td>ne_session *<var class="pdparam">session</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" title="Description"><a name="id462349"></a><h2>Description</h2><p>To indicate that a given certificate is trusted by the
2user, the certificate object can be passed to
3<code class="function">ne_ssl_trust_cert</code>.  The certificate object is
4duplicated internally and can subsequently be destroyed.</p><p>The SSL library in use by neon may include a default
5set of CA certificates; calling the
6<code class="function">ne_ssl_trust_default_ca</code> function will indicate
7that these CAs are trusted by the user.</p></div><div class="refsect1" title="Examples"><a name="id462374"></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(...);
8ne_ssl_certificate *cert = ne_ssl_cert_read("/path/to/cacert.pem");
9
10if (cert) {
11   ne_ssl_trust_cert(sess, cert);
12   ne_ssl_cert_free(cert);
13} else {
14   printf("Could not load CA cert: %s\n", ne_get_error(sess));
15}</pre></div><div class="refsect1" title="See also"><a name="id462396"></a><h2>See also</h2><p><a class="xref" href="refsslcertio.html#ne_ssl_cert_read">ne_ssl_cert_read</a>, <a class="xref" href="refsslcertio.html#ne_ssl_cert_import">ne_ssl_cert_import</a>, <a class="xref" 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>
16