dimanche 19 juillet 2015

Got AmazonClientException "hostname in certificate didn't match” when using SQS JAVA API

When using JAVA API of SQS (sdk version: 1.9.30), sometimes I got following exceptions:

com.amazonaws.AmazonClientException: Unable to execute HTTP request: hostname in certificate didn't match: <sqs.us-west-1.amazonaws.com> != <*.mycompany.com> OR <*.mycompany.com> OR <mycompany.com>
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:472)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:296)
    at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:2422)
    at com.amazonaws.services.sqs.AmazonSQSClient.sendMessage(AmazonSQSClient.java:1015)

There are some question like mine (i.e SSL problems with S3/AWS using the Java API: "hostname in certificate didn't match"), but seems not the same one. Because in my situation the exception is like:

[sqs url] != [my company's url]

looks like when I try to connect to AWS server, the sdk connect to my company's server for some reason, and make the SSL handshake fail.

There are other one got the same question (http://ift.tt/1eapvt8), but still have no answer.

Is this a bug of SDK and any solution for this?




Aucun commentaire:

Enregistrer un commentaire