---
name: "mongoc_client_encryption_opts_set_tls_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_encryption_opts_set_tls_opts"
---

# mongoc\_client\_encryption\_opts\_set\_tls\_opts(3)

## SYNOPSIS

```
void
mongoc_client_encryption_opts_set_tls_opts (
   mongoc_client_encryption_opts_t *opts, const bson_t *tls_opts);
```

## PARAMETERS

- •

  **opts**: The *mongoc\_client\_encryption\_opts\_t*

- •

  **tls\_opts**: A *bson\_t* mapping a Key Management Service (KMS) provider to a BSON document with TLS options.

**tls\_opts** is a BSON document of the following form:

```
<KMS provider>: {
   tlsCaFile: Optional<String>
   tlsCertificateKeyFile: Optional<String>
   tlsCertificateKeyFilePassword: Optional<String>
}
```

KMS providers are specified as a string of the form **\<KMS provider type\>** or **\<KMS provider type\>:\<KMS provider name\>**. The supported KMS provider types are **aws**, **azure**, **gcp**, **local**, and **kmip**. The optional name enables configuring multiple KMS providers with the same KMS provider type (e.g. **aws:name1** and **aws:name2** can refer to different AWS accounts).

**tls\_opts** maps the KMS provider to a BSON document for TLS options.

The BSON document for TLS options may contain the following keys:

- •

  **MONGOC\_URI\_TLSCERTIFICATEKEYFILE**

- •

  **MONGOC\_URI\_TLSCERTIFICATEKEYFILEPASSWORD**

- •

  **MONGOC\_URI\_TLSCAFILE**

Example use

```
mongoc_client_encryption_opts_t *ce_opts = mongoc_client_encryption_opts_new ();
bson_t *tls_opts = bson_new ();
BCON_APPEND (tls_opts, "kmip", "{", MONGOC_URI_TLSCAFILE, "ca1.pem", "}");
BCON_APPEND (tls_opts, "aws", "{", MONGOC_URI_TLSCAFILE, "ca2.pem", "}");
mongoc_client_encryption_opts_set_tls_opts (ce_opts, tls_opts);
```

See *Configuring TLS* for a description of the behavior of these options.

**SEE ALSO:**

```
In-Use Encryption
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
