---
name: "mongoc_client_set_ssl_opts"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_client_set_ssl_opts"
---

# mongoc\_client\_set\_ssl\_opts(3)

## SYNOPSIS

```
#ifdef MONGOC_ENABLE_SSL
void
mongoc_client_set_ssl_opts (mongoc_client_t *client,
                            const mongoc_ssl_opt_t *opts);
#endif
```

**NOTE:**

Though some API names include the term "ssl", the C driver only support TLS protocols, which supersede SSL.

Sets the TLS (SSL) options to use when connecting to TLS enabled MongoDB servers.

The *mongoc\_ssl\_opt\_t* struct is copied by the client along with the strings it points to (**pem\_file**, **pem\_pwd**, **ca\_file**, **ca\_dir**, and **crl\_file**) so they don't have to remain valid after the call to *mongoc\_client\_set\_ssl\_opts()*.

A call to *mongoc\_client\_set\_ssl\_opts()* overrides all TLS options set through the connection string with which the *mongoc\_client\_t* was constructed.

It is a programming error to call this function on a client from a *mongoc\_client\_pool\_t*. Instead, call *mongoc\_client\_pool\_set\_ssl\_opts()* on the pool before popping any clients.

## PARAMETERS

- •

  **client**: A *mongoc\_client\_t*.

- •

  **opts**: A *mongoc\_ssl\_opt\_t*.

## AVAILABILITY

This feature requires that the MongoDB C driver was compiled with **-DENABLE\_SSL**.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
