获得AmazonClientException"证书中的主机名与“使用SQS JAVA API时匹配”

时间:2015-07-20 05:25:01

标签: java ssl amazon-web-services amazon-sqs

当使用SQS的JAVA API(sdk版本:1.9.30)时,有时我会遇到以下例外情况:

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)

有一些像我这样的问题(即 SSL problems with S3/AWS using the Java API: "hostname in certificate didn't match"),但似乎不一样。因为在我的情况下,例外是:

[sqs url]!= [我公司的网址]

看起来当我尝试连接到AWS服务器时,由于某种原因,sdk连接到我公司的服务器,并使SSL握手失败。

还有其他人有同样的问题(https://github.com/Upplication/Amazon-S3-FileSystem-NIO2/issues/40),但仍然没有答案。

这是SDK及其解决方案的错误吗?

0 个答案:

没有答案