How to access both DocumentDB and S3 in the same Java program



I have a Java Spring Boot 2 application that needs to connect to both DocumentDB and S3.

As stated on I downloaded rds-combined-ca-bundle.pem, created a truststore and specified the system parameter As a result I can connect to DocumentDB with TLS but when I connect to S3 using the java SDK I now get

com.amazonaws.SdkClientException: Unable to execute HTTP request: PKIX path building failed: unable to find valid certification path to requested target

Does anyone knows how to connect to DocumentDB and other endpoints that needs SSL in a Java program?
I tried specifying the pem file on the MongoDB URI but the parameter ssl_ca_certs is not known by the driver.

asked 4 years ago1007 views
1 Answer

Hi. You can update the trustStore created for DocumentDB and add the AWS Truststore CA certificates - see keytool -importkeystore along with this blog. The certificates can be found here.

Mihai A
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions