@@ -3015,10 +3015,25 @@ func TestClientSideEncryptionProse(t *testing.T) {
30153015 keyVaultClient , err := mongo .Connect (options .Client ().ApplyURI (mtest .ClusterURI ()))
30163016 require .NoError (mt , err , "error on Connect: %v" , err )
30173017
3018+ tlsConfig := make (map [string ]* tls.Config )
3019+ if tlsCAFileKMIP != "" && tlsClientCertificateKeyFileKMIP != "" {
3020+ clientAndCATlsMap := map [string ]interface {}{
3021+ "tlsCertificateKeyFile" : tlsClientCertificateKeyFileKMIP ,
3022+ "tlsCAFile" : tlsCAFileKMIP ,
3023+ }
3024+ certConfig , err := options .BuildTLSConfig (clientAndCATlsMap )
3025+ assert .Nil (mt , err , "BuildTLSConfig error: %v" , err )
3026+ tlsConfig ["aws" ] = certConfig
3027+ tlsConfig ["azure" ] = certConfig
3028+ tlsConfig ["gcp" ] = certConfig
3029+ tlsConfig ["kmip" ] = certConfig
3030+ } else {
3031+ mt .Log ("empty tlsCertificateKeyFile and tlsCAFile" )
3032+ }
30183033 ceo := options .ClientEncryption ().
30193034 SetKeyVaultNamespace ("keyvault.datakeys" ).
30203035 SetKmsProviders (fullKmsProvidersMap ).
3021- SetTLSConfig (map [ string ] * tls. Config { "aws" : tlsCfg } )
3036+ SetTLSConfig (tlsConfig )
30223037 clientEncryption , err := mongo .NewClientEncryption (keyVaultClient , ceo )
30233038 require .NoError (mt , err , "error on NewClientEncryption: %v" , err )
30243039
0 commit comments