@@ -1306,7 +1306,7 @@ async def asyncSetUp(self):
13061306 kms_providers_invalid = copy .deepcopy (kms_providers )
13071307 kms_providers_invalid ["azure" ]["identityPlatformEndpoint" ] = "doesnotexist.invalid:443"
13081308 kms_providers_invalid ["gcp" ]["endpoint" ] = "doesnotexist.invalid:443"
1309- kms_providers_invalid ["kmip" ]["endpoint" ] = "doesnotexist.local :5698"
1309+ kms_providers_invalid ["kmip" ]["endpoint" ] = "doesnotexist.invalid :5698"
13101310 self .client_encryption_invalid = self .create_client_encryption (
13111311 kms_providers = kms_providers_invalid ,
13121312 key_vault_namespace = "keyvault.datakeys" ,
@@ -1364,15 +1364,10 @@ async def test_03_aws_region_key_endpoint_port(self):
13641364 },
13651365 )
13661366
1367- @unittest .skipUnless (any (AWS_CREDS .values ()), "AWS environment credentials are not set" )
1368- async def test_04_aws_endpoint_invalid_port (self ):
1369- master_key = {
1370- "region" : "us-east-1" ,
1371- "key" : ("arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0" ),
1372- "endpoint" : "kms.us-east-1.amazonaws.com:12345" ,
1373- }
1374- with self .assertRaisesRegex (EncryptionError , "kms.us-east-1.amazonaws.com:12345" ):
1375- await self .client_encryption .create_data_key ("aws" , master_key = master_key )
1367+ async def test_04_kmip_endpoint_invalid_port (self ):
1368+ master_key = {"keyId" : "1" , "endpoint" : "localhost:12345" }
1369+ with self .assertRaisesRegex (EncryptionError , "localhost:12345" ):
1370+ await self .client_encryption .create_data_key ("kmip" , master_key = master_key )
13761371
13771372 @unittest .skipUnless (any (AWS_CREDS .values ()), "AWS environment credentials are not set" )
13781373 async def test_05_aws_endpoint_wrong_region (self ):
@@ -1478,7 +1473,7 @@ async def test_11_kmip_master_key_endpoint(self):
14781473 self .assertEqual ("test" , await self .client_encryption_invalid .decrypt (encrypted ))
14791474
14801475 async def test_12_kmip_master_key_invalid_endpoint (self ):
1481- key = {"keyId" : "1" , "endpoint" : "doesnotexist.local :5698" }
1476+ key = {"keyId" : "1" , "endpoint" : "doesnotexist.invalid :5698" }
14821477 with self .assertRaisesRegex (EncryptionError , self .kmip_host_error ):
14831478 await self .client_encryption .create_data_key ("kmip" , key )
14841479
@@ -2166,7 +2161,7 @@ async def test_01_aws(self):
21662161 await self .client_encryption_invalid_hostname .create_data_key ("aws" , key )
21672162
21682163 async def test_02_azure (self ):
2169- key = {"keyVaultEndpoint" : "doesnotexist.local " , "keyName" : "foo" }
2164+ key = {"keyVaultEndpoint" : "doesnotexist.invalid " , "keyName" : "foo" }
21702165 # Missing client cert error.
21712166 with self .assertRaisesRegex (EncryptionError , self .cert_error ):
21722167 await self .client_encryption_no_client_cert .create_data_key ("azure" , key )
@@ -2241,7 +2236,7 @@ async def test_06_named_kms_providers_apply_tls_options_aws(self):
22412236 await self .client_encryption_with_names .create_data_key ("aws:with_tls" , key )
22422237
22432238 async def test_06_named_kms_providers_apply_tls_options_azure (self ):
2244- key = {"keyVaultEndpoint" : "doesnotexist.local " , "keyName" : "foo" }
2239+ key = {"keyVaultEndpoint" : "doesnotexist.invalid " , "keyName" : "foo" }
22452240 # Missing client cert error.
22462241 with self .assertRaisesRegex (EncryptionError , self .cert_error ):
22472242 await self .client_encryption_with_names .create_data_key ("azure:no_client_cert" , key )
0 commit comments