NE_SSL_CONTEXT_CREAT(3)
β¨ NAME β¨
okay so bestie, welcome to the neon SSL context management function squad π β this is the whole group chat: ne_ssl_context_create, ne_ssl_context_trustcert, ne_ssl_context_trustdefca, ne_ssl_context_keypair, ne_ssl_context_set_clicert, ne_ssl_context_set_ccprovide, ne_ssl_context_set_versions, ne_ssl_context_set_verify, ne_ssl_context_set_flag, ne_ssl_context_get_flag, ne_ssl_context_destroy β literally all of them are the SSL context management functions. periodt. π
πΈ SYNOPSIS πΈ
#include <ne_ssl.h>
ne_ssl_context *ne_ssl_context_create(int mode);
void ne_ssl_context_trustcert(ne_ssl_context *ctx,
const ne_ssl_certificate *cert);
void ne_ssl_context_trustdefca(ne_ssl_context *ctx);
int ne_ssl_context_keypair(ne_ssl_context *ctx, const char *cert,
const char *key);
void ne_ssl_context_set_clicert(ne_ssl_context *ctx,
const ne_ssl_client_cert *cc);
void ne_ssl_context_set_ccprovide(ne_ssl_context *ctx,
ne_ssl_ccprovide_fn provider,
void *userdata);
int ne_ssl_context_set_versions(ne_ssl_context *ctx,
enum ne_ssl_protocol min,
enum ne_ssl_protocol max);
int ne_ssl_context_set_verify(ne_ssl_context *ctx, int required,
const char *ca_names,
const char *verify_cas);
void ne_ssl_context_set_flag(ne_ssl_context *ctx, int flag, int value);
int ne_ssl_context_get_flag(ne_ssl_context *ctx, int flag);
void ne_ssl_context_destroy(ne_ssl_context *ctx);
π DESCRIPTION π
ne_ssl_context_create is the moment of creation, the birth of your very own SSL context object π¦. The mode parameter should be NE_SSL_CTX_CLIENT if you want a client context, or NE_SSL_CTX_SERVER if you want a server context. pick your fighter.
ne_ssl_context_trustcert β for a client context, this one configures the context to trust the certificate cert. like, yes babe, we stan that cert, it's in the trust circle now π«Ά.
ne_ssl_context_trustdefca β also for a client context, this configures the context to trust the default system certificate authorities. the classics. the originals. the ones that were already famous π.
ne_ssl_context_keypair β for a server context, this configures the server certificate and private key π. The cert and key parameters are filenames to PEM-encoded certificates. filenames, bestie, not the certs themselves, don't get it twisted.
ne_ssl_context_set_clicert β configures a client certificate for a client context π. The client certificate cc must be in the decrypted state β no locked-up vibes allowed. Also the certificate object is duplicated internally, so the caller is totally free to destroy it after the function returns. no hard feelings, we made a copy π
.
ne_ssl_context_set_ccprovide β registers a callback to provide a client certificate on demand, if the server asks for one π. The provider callback gets passed the userdata pointer, an array of acceptable CA distinguished names, and the count of names in that array. so it's giving "we'll see what we have when they ask".
ne_ssl_context_set_versions β sets the minimum and maximum SSL/TLS protocol versions allowed for the connection ππ. This must be called before initiating the SSL handshake. like, before. not during. before. no cap.
ne_ssl_context_set_verify β for a server context, this configures client certificate verification π. If required is non-zero, a client certificate is required (no cert, no entry, sorry queen). If ca_names is non-NULL, it specifies a filename containing PEM certificates from which CA names are sent in the client certificate request. The verify_cas parameter specifies the CAs used for verification.
ne_ssl_context_set_flag β sets a flag for the SSL context π©. And ne_ssl_context_get_flag retrieves the current value of a flag. No flags are currently defined. yes really. the flag closet is empty bestie, it's giving minimalist π.
ne_ssl_context_destroy β destroys an SSL context object and frees all associated resources π§Ήβ¨. it's the goodbye era. everything gets cleaned up.
π RETURN VALUE π
ne_ssl_context_createreturns an SSL context object, orNULLon error π.ne_ssl_context_keypair,ne_ssl_context_set_versions, andne_ssl_context_set_verifyreturn zero on success, or non-zero on error. zero is the slay number, non-zero is the not-slaying number.ne_ssl_context_get_flagreturns the flag value. that's it, that's the tea π .
π¦ HISTORY π¦
ne_ssl_context_set_clicert and ne_ssl_context_trustdefca are available in neon 0.37.0 and later β. the newer icons on the block, and honestly? they ate.
π SEE ALSO π
ne_sock_handshake(3) β go read that one too bestie, iykyk π
π COPYRIGHT π
Copyright Β© 2001-2026 Joe Orton
and that's the whole page, fr fr π this was the neon API reference energy, brought to you by neon 0.37.1, dated 15 March 2026 β mwah, stan, slay, go forth and manage your SSL contexts responsibly π§β¨
π¦ where this page comes from
- epel 10: neon-devel 0.37.1-4.el10_3 Β· LGPL-2.0-or-later AND GPL-2.0-or-later
- fedora 43: neon-devel 0.37.1-1.fc43 Β· LGPL-2.0-or-later AND GPL-2.0-or-later
- fedora 43: neon-devel 0.37.1-1.fc43 Β· LGPL-2.0-or-later AND GPL-2.0-or-later
- fedora 44: neon-devel 0.37.1-1.fc44 Β· LGPL-2.0-or-later AND GPL-2.0-or-later
- fedora 44: neon-devel 0.37.1-1.fc44 Β· LGPL-2.0-or-later AND GPL-2.0-or-later
- nixos 26.05: neon 0.37.1
- nixpkgs unstable: neon 0.37.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms