MONGOC_CLIENT_POOL_SET_SSL_OPTS(3)

✨ MONGOC_CLIENT_POOL_SET_SSL_OPTS(3) ✨

okay so this is a page from the libmongoc manual, bestie πŸ’– and it's all about setting your TLS options on a whole entire client pool at once. no cap, it's a glow-up for every client in the pool at the same time ✨


🌸 SYNOPSIS 🌸

#ifdef MONGOC_ENABLE_SSL
void
mongoc_client_pool_set_ssl_opts (mongoc_client_pool_t *pool,
                                 const mongoc_ssl_opt_t *opts);
#endif
⚠️ NOTE: bestie, listen β€” even though some API names literally have the word "ssl" in them, the C driver only supports TLS protocols, which supersede SSL. so like, "ssl" in the name is giving legacy aesthetic, but it's TLS under the hood πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

This function is literally identical to mongoc_client_set_ssl_opts() except it's for client pools instead of a single client. same energy, different scope 🫢

It makes sure that every single client you pull out of mongoc_client_pool_pop() or mongoc_client_pool_try_pop() is configured with the exact same TLS settings. no stragglers, no rogue vibes, everybody matching. main character consistency πŸ‘‘

The mongoc_ssl_opt_t struct gets copied by the pool β€” and so do all the strings it points to (pem_file, pem_pwd, ca_file, ca_dir, and crl_file). so those don't have to stay valid after you call mongoc_client_pool_set_ssl_opts(). you can let them go, they've served their purpose, we love a clean break 😭✨

Calling mongoc_client_pool_set_ssl_opts() overrides all TLS options that were set through the connection string you used to construct the mongoc_client_pool_t. yep, all of them. this call is the moment, it takes over πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • pool β€” a mongoc_client_pool_t. the pool in question, your little client farm 🌈
  • opts β€” a mongoc_ssl_opt_t. all your TLS settings, bundled up cute πŸ“

πŸ’œ THREAD SAFETY πŸ’œ

πŸ’€ This function can only be called once on a pool, and it must be called before the first call to mongoc_client_pool_pop().

so like… once. before the popping. that's the rule. periodt πŸ™ˆ


⭐ AVAILABILITY ⭐

This feature requires that the MongoDB C driver was compiled with -DENABLE_SSL. no flag, no function, iykyk πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc


2009-present, MongoDB, Inc.


and that's the whole page, bestie πŸ’– this lovely little number comes to you from libmongoc version 2.5.6, dated Oct 09, 2021 β€” catch you in the next manual page, muah πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from