ssltrust.xml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <refentry id="refsslca">
  2. <refmeta>
  3. <refentrytitle>ne_ssl_trust_cert</refentrytitle>
  4. <manvolnum>3</manvolnum>
  5. </refmeta>
  6. <refnamediv>
  7. <refname id="ne_ssl_trust_cert">ne_ssl_trust_cert</refname>
  8. <refname id="ne_ssl_trust_default_ca">ne_ssl_trust_default_ca</refname>
  9. <refpurpose>functions to indicate that certificates are trusted</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <funcsynopsis>
  13. <funcsynopsisinfo>#include &lt;ne_session.h&gt;</funcsynopsisinfo>
  14. <funcprototype>
  15. <funcdef>void <function>ne_ssl_trust_cert</function></funcdef>
  16. <paramdef>ne_session *<parameter>session</parameter></paramdef>
  17. <paramdef>const ne_ssl_certificate *<parameter>cert</parameter></paramdef>
  18. </funcprototype>
  19. <funcprototype>
  20. <funcdef>void <function>ne_ssl_trust_default_ca</function></funcdef>
  21. <paramdef>ne_session *<parameter>session</parameter></paramdef>
  22. </funcprototype>
  23. </funcsynopsis>
  24. </refsynopsisdiv>
  25. <refsect1>
  26. <title>Description</title>
  27. <para>To indicate that a given certificate is trusted by the
  28. user, the certificate object can be passed to
  29. <function>ne_ssl_trust_cert</function>. The certificate object is
  30. duplicated internally and can subsequently be destroyed.</para>
  31. <para>The SSL library in use by &neon; may include a default
  32. set of CA certificates; calling the
  33. <function>ne_ssl_trust_default_ca</function> function will indicate
  34. that these CAs are trusted by the user.</para>
  35. </refsect1>
  36. <refsect1>
  37. <title>Examples</title>
  38. <para>Load the CA certificate stored in <filename>/path/to/cacert.pem</filename>:</para>
  39. <programlisting>&egsess;
  40. ne_ssl_certificate *cert = ne_ssl_cert_read("/path/to/cacert.pem");
  41. if (cert) {
  42. ne_ssl_trust_cert(sess, cert);
  43. ne_ssl_cert_free(cert);
  44. } else {
  45. printf("Could not load CA cert: %s\n", ne_get_error(sess));
  46. }</programlisting>
  47. </refsect1>
  48. <refsect1>
  49. <title>See also</title>
  50. <para><xref linkend="ne_ssl_cert_read"/>, <xref
  51. linkend="ne_ssl_cert_import"/>, <xref
  52. linkend="ne_ssl_cert_free"/></para> </refsect1>
  53. </refentry>