Skip to content

Commit 5de8fcb

Browse files
committed
update tests to use new set_tls_opts helpers
1 parent 6ea668f commit 5de8fcb

File tree

2 files changed

+192
-93
lines changed

2 files changed

+192
-93
lines changed

src/libmongoc/tests/json-test.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,7 @@ set_auto_encryption_opts (mongoc_client_t *client, bson_t *test)
14041404
bson_error_t error;
14051405
bool ret;
14061406
bson_t extra;
1407+
bson_t tls_opts = BSON_INITIALIZER;
14071408

14081409
if (!bson_has_field (test, "clientOptions.autoEncryptOpts")) {
14091410
return;
@@ -1527,11 +1528,13 @@ set_auto_encryption_opts (mongoc_client_t *client, bson_t *test)
15271528

15281529
bson_concat (
15291530
&kms_providers,
1530-
tmp_bson ("{ 'kmip': { 'endpoint': '%s', 'tls': { 'tlsCAFile': "
1531-
"'%s', 'tlsCertificateKeyFile': '%s' } } }",
1532-
kmip_endpoint,
1533-
kmip_tls_ca_file,
1534-
kmip_tls_certificate_key_file));
1531+
tmp_bson ("{ 'kmip': { 'endpoint': '%s' }}", kmip_endpoint));
1532+
1533+
bson_concat (&tls_opts,
1534+
tmp_bson ("{'kmip': { 'tlsCAFile': '%s', "
1535+
"'tlsCertificateKeyFile': '%s' } }",
1536+
kmip_tls_ca_file,
1537+
kmip_tls_certificate_key_file));
15351538

15361539
bson_free (kmip_endpoint);
15371540
bson_free (kmip_tls_ca_file);
@@ -1540,7 +1543,9 @@ set_auto_encryption_opts (mongoc_client_t *client, bson_t *test)
15401543

15411544
mongoc_auto_encryption_opts_set_kms_providers (auto_encryption_opts,
15421545
&kms_providers);
1546+
mongoc_auto_encryption_opts_set_tls_opts (auto_encryption_opts, &tls_opts);
15431547
bson_destroy (&kms_providers);
1548+
bson_destroy (&tls_opts);
15441549
}
15451550

15461551
if (bson_iter_init_find (&iter, &opts, "schemaMap")) {

0 commit comments

Comments
 (0)