Aws-sdk-java: Unable to execute HTTP request

Created on 1 Sep 2016  路  9Comments  路  Source: aws/aws-sdk-java

Hi,
I am using the latest java AWS SDK 1.11.30.

When I try to execute a request, for example whether a specified bucket exists,
I receive the following exception which happens from time to time and
for certain regions:
com.amazonaws.AmazonClientException: 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
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:724)
at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:466)
at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:427)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:376)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4039)
at com.amazonaws.services.s3.AmazonS3Client.headBucket(AmazonS3Client.java:1234)
at com.amazonaws.services.s3.AmazonS3Client.doesBucketExist(AmazonS3Client.java:1191)

Regions that I do not observe this issue are US located. Issue occurs with EU and Asia regions.
Regards

Most helpful comment

FYI, I ran into this issue when I have Charles proxy enabled...

All 9 comments

What version of Java are you using? Sounds like you have outdated certs installed that can't validate newer regions.

Are you seeing the issue consistently for those regions or just periodically?

Hi,
I am using java 1.8.0_92. I thought it might be certs related. This happens randomly for the problematic regions. I am executing the code on VM with suse linux.

When run the same code on my Win machine with same Java version I do not observe the issue.
Do you think it will be a good idea to switch to Rest calls using java or any other suggestions.
Is there any way to see endpoint java versions? Except for the cacerts, could anything else be the problem related to java version?

One other question, is there any example in java that I can use trying to tunnel all aws calls through Socks and HTTP Proxies?

Thanks

Hi,
This happens randomly, for mentioned regions EU and Asia, no matter what is the Java version. It happens on Win and Linux, but only to VM lab machines. On my computer is ok. I am not sure, is some routing, TTL etc. not sure. I have copied cacerts file from my comp to the java versions on the VMs, even imported manually the certificate der file, from the console site, same result.

Please let me know if you have some info about those proxies.

Thanks

Hi @nikolaitn
I had a similar problem, I resolved to see http://stackoverflow.com/a/30699960
(AWS EC2 + Ubuntu 14.04 + Open JDK 8 + AWS SDK Java)

FYI, I ran into this issue when I have Charles proxy enabled...

@yzhong52 May I know how do you solve it with Charles Proxy enabled? Need this very much. Thanks.

@AllysonYuShiong You probably have a different problem. I had this issue when I have Charles proxy enabled. It works after I close it.

@yzhong52 thanks for reply. I need to restart my machine in order for it to work. I need to use charles proxy to capture the traffic so I must have charles proxy turned on. I tried cacerts and use us-west-2 region still it doesn't work with charles proxy.

FYI, I ran into this issue when I have Charles proxy enabled...

I had the exact same issue with the Fiddler proxy enabled.

Was this page helpful?
0 / 5 - 0 ratings