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

0

Hello,

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

As stated on https://docs.aws.amazon.com/documentdb/latest/developerguide/connect_programmatically.html I downloaded rds-combined-ca-bundle.pem, created a truststore and specified the system parameter javax.net.ssl.trustStore. 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: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
in
com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4365)

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.

질문됨 4년 전927회 조회
1개 답변
0

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.

AWS
Mihai A
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠