NE_SSL_TRUST_CERT(3)

πŸ’– NE_SSL_TRUST_CERT(3) β€” neon API reference πŸ’–

okay bestie, welcome to the neon API reference page for ne_ssl_trust_cert and ne_ssl_trust_default_ca. It’s literally all about telling neon β€œyes, this certificate is trusted by the user,” no cap. πŸ’…


🌸 NAME 🌸

  • ne_ssl_trust_cert, ne_ssl_trust_default_ca β€” functions to indicate that certificates are trusted. That’s the whole vibe check: you’re handing neon a trust signal. 🫢

✨ SYNOPSIS ✨

#include <ne_session.h>

void ne_ssl_trust_cert(ne_session *session,
                       const ne_ssl_certificate *cert);

void ne_ssl_trust_default_ca(ne_session *session);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here’s the tea: when you want to say a given certificate is trusted by the user, you pass that certificate object into ne_ssl_trust_cert. The certificate object gets duplicated internally, so you can destroy it afterwards and still be fine. Slay. πŸ’–

The SSL library that neon is using may already include a default set of CA certificates. If you call ne_ssl_trust_default_ca, that tells neon those CAs are trusted by the user. It’s giving β€œdefault trust set, but make it official.” πŸ‘‘

πŸŽ€ EXAMPLES πŸŽ€

Load the CA certificate stored in /path/to/cacert.pem:

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));
}

🧚 HISTORY 🧚

Okay, important lore: ne_ssl_trust_default_ca is not safe to call for non-SSL sessions in versions of neon before 0.33.0. In 0.33.0 and later, this function is a no-op for non-SSL sessions. So if you’re on old neon, don’t be messy with it. 😭

🌈 SEE ALSO 🌈

Copyright Β© 2001-2026 Joe Orton


🫢 That’s the whole manual page, bestie β€” from neon, dated 03/20/2026. Bye! πŸ’–
πŸ“¦ where this page comes from