ne_ssl_trust_cert.3 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. '\" t
  2. .\" Title: ne_ssl_trust_cert
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
  5. .\" Date: 30 September 2016
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.30.2
  8. .\" Language: English
  9. .\"
  10. .TH "NE_SSL_TRUST_CERT" "3" "30 September 2016" "neon 0.30.2" "neon API reference"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. ne_ssl_trust_cert, ne_ssl_trust_default_ca \- functions to indicate that certificates are trusted
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <ne_session\&.h>
  37. .fi
  38. .ft
  39. .HP \w'void\ ne_ssl_trust_cert('u
  40. .BI "void ne_ssl_trust_cert(ne_session\ *" "session" ", const\ ne_ssl_certificate\ *" "cert" ");"
  41. .HP \w'void\ ne_ssl_trust_default_ca('u
  42. .BI "void ne_ssl_trust_default_ca(ne_session\ *" "session" ");"
  43. .SH "DESCRIPTION"
  44. .PP
  45. To indicate that a given certificate is trusted by the user, the certificate object can be passed to
  46. \fBne_ssl_trust_cert\fR\&. The certificate object is duplicated internally and can subsequently be destroyed\&.
  47. .PP
  48. The SSL library in use by neon may include a default set of CA certificates; calling the
  49. \fBne_ssl_trust_default_ca\fR
  50. function will indicate that these CAs are trusted by the user\&.
  51. .SH "EXAMPLES"
  52. .PP
  53. Load the CA certificate stored in
  54. /path/to/cacert\&.pem:
  55. .sp
  56. .if n \{\
  57. .RS 4
  58. .\}
  59. .nf
  60. ne_session *sess = ne_session_create(\&.\&.\&.);
  61. ne_ssl_certificate *cert = ne_ssl_cert_read("/path/to/cacert\&.pem");
  62. if (cert) {
  63. ne_ssl_trust_cert(sess, cert);
  64. ne_ssl_cert_free(cert);
  65. } else {
  66. printf("Could not load CA cert: %s\en", ne_get_error(sess));
  67. }
  68. .fi
  69. .if n \{\
  70. .RE
  71. .\}
  72. .SH "SEE ALSO"
  73. .PP
  74. ne_ssl_cert_read,
  75. ne_ssl_cert_import,
  76. ne_ssl_cert_free
  77. .SH "AUTHOR"
  78. .PP
  79. \fBJoe Orton\fR <\&[email protected]\&>
  80. .RS 4
  81. Author.
  82. .RE
  83. .SH "COPYRIGHT"
  84. .br