@@ -1142,7 +1142,7 @@ _endpoint_setup (mongoc_client_t *keyvault_client,
1142
1142
"'endpoint': 'doesnotexist.invalid'}}" ,
1143
1143
mongoc_test_gcp_email ,
1144
1144
mongoc_test_gcp_privatekey ));
1145
- bson_concat (kms_providers_invalid , tmp_bson ("{'kmip': { 'endpoint': 'doesnotexist.local :5698' }}" ));
1145
+ bson_concat (kms_providers_invalid , tmp_bson ("{'kmip': { 'endpoint': 'doesnotexist.invalid :5698' }}" ));
1146
1146
1147
1147
client_encryption_opts = mongoc_client_encryption_opts_new ();
1148
1148
mongoc_client_encryption_opts_set_kms_providers (client_encryption_opts , kms_providers );
@@ -1284,18 +1284,13 @@ test_custom_endpoint (void *unused)
1284
1284
* included.
1285
1285
* Expect to fail with socket error */
1286
1286
_endpoint_setup (keyvault_client , & client_encryption , & client_encryption_invalid );
1287
- masterkey = BCON_NEW ("region" ,
1288
- "us-east-1" ,
1289
- "key" ,
1290
- "arn:aws:kms:us-east-1:579766882180:key/"
1291
- "89fcc2c4-08b0-4bd9-9f25-e30687b580d0" ,
1292
- "endpoint" ,
1293
- "kms.us-east-1.amazonaws.com:12345" );
1287
+ masterkey = BCON_NEW ("keyId" , "1" , "endpoint" , "localhost:12345" );
1294
1288
mongoc_client_encryption_datakey_opts_set_masterkey (datakey_opts , masterkey );
1295
- res = mongoc_client_encryption_create_datakey (client_encryption , "aws " , datakey_opts , & keyid , & error );
1289
+ res = mongoc_client_encryption_create_datakey (client_encryption , "kmip " , datakey_opts , & keyid , & error );
1296
1290
ASSERT_ERROR_CONTAINS (error , MONGOC_ERROR_STREAM , MONGOC_ERROR_STREAM_CONNECT , "Failed to connect" );
1297
1291
BSON_ASSERT (!res );
1298
1292
bson_value_destroy (& keyid );
1293
+
1299
1294
bson_destroy (masterkey );
1300
1295
mongoc_client_encryption_destroy (client_encryption );
1301
1296
mongoc_client_encryption_destroy (client_encryption_invalid );
@@ -1447,7 +1442,7 @@ test_custom_endpoint (void *unused)
1447
1442
1448
1443
/* Case 12: KMIP overriding with invalid endpoint. */
1449
1444
_endpoint_setup (keyvault_client , & client_encryption , & client_encryption_invalid );
1450
- masterkey = BCON_NEW ("keyId" , "1" , "endpoint" , "doesnotexist.local :5698" );
1445
+ masterkey = BCON_NEW ("keyId" , "1" , "endpoint" , "doesnotexist.invalid :5698" );
1451
1446
mongoc_client_encryption_datakey_opts_set_masterkey (datakey_opts , masterkey );
1452
1447
res = mongoc_client_encryption_create_datakey (client_encryption , "kmip" , datakey_opts , & keyid , & error );
1453
1448
ASSERT_ERROR_CONTAINS (error , MONGOC_ERROR_STREAM , MONGOC_ERROR_STREAM_NAME_RESOLUTION , "Failed to resolve" );
@@ -2940,7 +2935,7 @@ test_kms_tls_options (void *unused)
2940
2935
memset (& error , 0 , sizeof (bson_error_t ));
2941
2936
dkopts = mongoc_client_encryption_datakey_opts_new ();
2942
2937
mongoc_client_encryption_datakey_opts_set_masterkey (
2943
- dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.local ', 'keyName': 'foo' }" ));
2938
+ dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.invalid ', 'keyName': 'foo' }" ));
2944
2939
res = mongoc_client_encryption_create_datakey (client_encryption_no_client_cert , "azure" , dkopts , & keyid , & error );
2945
2940
ASSERT_ERROR_CONTAINS (error , MONGOC_ERROR_STREAM , MONGOC_ERROR_STREAM_SOCKET , "" );
2946
2941
ASSERT (!res );
@@ -2950,7 +2945,7 @@ test_kms_tls_options (void *unused)
2950
2945
memset (& error , 0 , sizeof (bson_error_t ));
2951
2946
dkopts = mongoc_client_encryption_datakey_opts_new ();
2952
2947
mongoc_client_encryption_datakey_opts_set_masterkey (
2953
- dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.local ', 'keyName': 'foo' }" ));
2948
+ dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.invalid ', 'keyName': 'foo' }" ));
2954
2949
res = mongoc_client_encryption_create_datakey (
2955
2950
client_encryption_with_names , "azure:no_client_cert" , dkopts , & keyid , & error );
2956
2951
ASSERT_ERROR_CONTAINS (error , MONGOC_ERROR_STREAM , MONGOC_ERROR_STREAM_SOCKET , "" );
@@ -2961,7 +2956,7 @@ test_kms_tls_options (void *unused)
2961
2956
memset (& error , 0 , sizeof (bson_error_t ));
2962
2957
dkopts = mongoc_client_encryption_datakey_opts_new ();
2963
2958
mongoc_client_encryption_datakey_opts_set_masterkey (
2964
- dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.local ', 'keyName': 'foo' }" ));
2959
+ dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.invalid ', 'keyName': 'foo' }" ));
2965
2960
res = mongoc_client_encryption_create_datakey (client_encryption_with_tls , "azure" , dkopts , & keyid , & error );
2966
2961
ASSERT_ERROR_CONTAINS (error , MONGOC_ERROR_CLIENT_SIDE_ENCRYPTION , mongocrypt_errno , "HTTP status=404" );
2967
2962
ASSERT (!res );
@@ -2971,7 +2966,7 @@ test_kms_tls_options (void *unused)
2971
2966
memset (& error , 0 , sizeof (bson_error_t ));
2972
2967
dkopts = mongoc_client_encryption_datakey_opts_new ();
2973
2968
mongoc_client_encryption_datakey_opts_set_masterkey (
2974
- dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.local ', 'keyName': 'foo' }" ));
2969
+ dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.invalid ', 'keyName': 'foo' }" ));
2975
2970
res =
2976
2971
mongoc_client_encryption_create_datakey (client_encryption_with_names , "azure:with_tls" , dkopts , & keyid , & error );
2977
2972
ASSERT_ERROR_CONTAINS (error , MONGOC_ERROR_CLIENT_SIDE_ENCRYPTION , mongocrypt_errno , "HTTP status=404" );
@@ -2982,7 +2977,7 @@ test_kms_tls_options (void *unused)
2982
2977
memset (& error , 0 , sizeof (bson_error_t ));
2983
2978
dkopts = mongoc_client_encryption_datakey_opts_new ();
2984
2979
mongoc_client_encryption_datakey_opts_set_masterkey (
2985
- dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.local ', 'keyName': 'foo' }" ));
2980
+ dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.invalid ', 'keyName': 'foo' }" ));
2986
2981
res = mongoc_client_encryption_create_datakey (client_encryption_expired , "azure" , dkopts , & keyid , & error );
2987
2982
ASSERT_EXPIRED (error );
2988
2983
ASSERT (!res );
@@ -2992,7 +2987,7 @@ test_kms_tls_options (void *unused)
2992
2987
memset (& error , 0 , sizeof (bson_error_t ));
2993
2988
dkopts = mongoc_client_encryption_datakey_opts_new ();
2994
2989
mongoc_client_encryption_datakey_opts_set_masterkey (
2995
- dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.local ', 'keyName': 'foo' }" ));
2990
+ dkopts , tmp_bson ("{ 'keyVaultEndpoint': 'doesnotexist.invalid ', 'keyName': 'foo' }" ));
2996
2991
res = mongoc_client_encryption_create_datakey (client_encryption_invalid_hostname , "azure" , dkopts , & keyid , & error );
2997
2992
ASSERT_INVALID_HOSTNAME (error );
2998
2993
ASSERT (!res );
0 commit comments