ne_ssl_trust_cert.3 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. '\" t
  2. .\" Title: ne_ssl_trust_cert
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 15 July 2025
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.35.0
  8. .\" Language: English
  9. .\"
  10. .TH "NE_SSL_TRUST_CERT" "3" "15 July 2025" "neon 0.35.0" "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 "HISTORY"
  73. .PP
  74. \fBne_ssl_trust_default_ca\fR
  75. is not safe to call for non\-SSL sessions versions of neon before 0\&.33\&.0\&. In 0\&.33\&.0 and later, this function is a no\-op for non\-SSL sessions\&.
  76. .SH "SEE ALSO"
  77. .PP
  78. ne_session_create,
  79. ne_ssl_cert_read,
  80. ne_ssl_cert_import,
  81. ne_ssl_cert_free
  82. .SH "COPYRIGHT"
  83. .br
  84. Copyright \(co 2001-2025 Joe Orton
  85. .br