Reputation: 11
I am trying to connect to on-premise MongoDB from AWS Glue.
I have created a Database connection with connection type as MongoDB, SSL enabled true, VPC, Subnet, Security group in AWS console. I added a ETL Python script to connect the MongoDB.
while executing the script, the job throws below SSL error
py4j.protocol.Py4JJavaError: An error occurred while calling o114.getDynamicFrame.
: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=*********, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target}, caused by {sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target}, caused by {sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target}}]
at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:177)
Any suggestion to fix this issue? Since, there is no option to provide ssl cert while creating the MongoDB data connection in AWS Glue Console.
Upvotes: 0
Views: 861
Reputation: 16143
MongoDB has a native ODBC driver called as MongoDB Connector for BI. An approach to try might be to install that on a host running MongoDB, then connect to that host from Glue as if it were a MySQL database. The BI Connector supports SSL/TLS to the database from the connector.
Upvotes: 0