MONGOC_SSL_OPT_T(3)

πŸ’… MONGOC_SSL_OPT_T(3) πŸ’…

okay so this is a page from the libmongoc manual, and it's literally about one little struct that holds all your TLS settings, and honestly? iconic. let's get into it 🫢


✨ SYNOPSIS ✨

here's the whole vibe, memorized bestie, don't touch the punctuation:

typedef struct {
   const char *pem_file;
   const char *pem_pwd;
   const char *ca_file;
   const char *ca_dir;
   const char *crl_file;
   bool weak_cert_validation;
   bool allow_invalid_hostname;
   void *internal;
   void *padding[6];
} mongoc_ssl_opt_t;
NOTE (read this, seriously) πŸŽ€ β€” even though some API names still be saying "ssl" (we don't make the rules), the C driver only supports TLS protocols, which are the glow-up that supersedes SSL. so like. no cap. it's TLS. πŸ’…

🌸 DESCRIPTION 🌸

so this struct is the whole point of the page: you use it to set the TLS options for a mongoc_client_t or a mongoc_client_pool_t. that's it, that's the job. ✨

starting in version 1.2.0, once a pool or client has any TLS options set, like, all connections use TLS β€” even if you omit ssl=true from the MongoDB URI. before that? messy. TLS options were straight-up ignored unless tls=true was included in the URI. 😭

as of 1.4.0, mongoc_client_pool_set_ssl_opts() and mongoc_client_set_ssl_opts() don't just shallow copy the struct β€” they also copy the const char*. so the whole "make sure your values stay valid after setting them" era is over, bestie, you can relax now πŸ’†β€β™€οΈβœ¨

πŸ¦‹ SEE ALSO

  • Configuring TLS
  • mongoc_client_set_ssl_opts()
  • mongoc_client_pool_set_ssl_opts()

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the main characters, fr fr

2009-present, MongoDB, Inc. β€” periodt πŸ’–


and that's the page!! πŸŽ€ this was libmongoc version 2.5.6, dated Oct 09, 2026 β€” drink some water and go set your TLS options responsibly, bestie πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from