[CDRIVER-4222] Add private helper to construct mongoc_ssl_opt_t from BSON Created: 08/Nov/21  Updated: 28/Oct/23  Resolved: 08/Nov/21

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.20.0

Type: Improvement Priority: Unknown
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: CSFLE 1.0 KMIP support
Quarter: FY22Q4

 Description   

Background & Motivation
CSFLE has a requirement to configure TLS options for each KMS provider. The specification provides example API:

   // setTLSOptions accepts a map of KMS provider names to TLSOptions.
   // The TLSOptions apply to any TLS socket required to communicate
   // with the KMS provider.
   setTLSOptions (opts Map<String, TLSOptions>)

The planned API in libmongoc is to use a bson_t to represent the map to be consistent with mongoc_auto_encryption_opts_set_kms_providers :

MONGOC_EXPORT (void)
mongoc_auto_encryption_opts_set_tls_opts (
   mongoc_auto_encryption_opts_t *opts,
   const bson_t *tls_opts);

Creating a TLS stream with mongoc_stream_tls_new_with_hostname requires a mongoc_ssl_opt_t.

To aid with implementation, create a private helper to construct a mongoc_ssl_opt_t from a bson_t containing TLS options.

Scope

  • Create a private helper to construct a mongoc_ssl_opt_t from a bson_t containing TLS options.
  • Parse BSON keys with the "tls" prefixed options in the URI Options specification.


 Comments   
Comment by Githook User [ 08/Nov/21 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4222 add _mongoc_ssl_opts_from_bson (#886)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/a6184236b208c564c0ef683e52413091834fcccb

Generated at Wed Feb 07 21:20:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.