java - 亚马逊 : SSLHandshakeException happening intermittently

标签 java amazon-web-services

这对我来说是一个难题。下面显示了当我尝试进行亚马逊搜索时抛出异常的代码部分:

AWSECommerceServiceLocator locator = new AWSECommerceServiceLocator(fooConfig);
locator.setAWSECommerceServicePortEndpointAddress(SourceCountry.USA.getPortAddress());
//throws exception
AWSECommerceServicePortType type = locator.getAWSECommerceServicePort(); 

异常(exception)情况如下:

NativeException: bc.exceptions.FatalException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

奇怪的是,这种情况间歇性地发生。有时,一切都很完美。有人有什么想法吗?此时,我们非常感谢任何帮助。

谢谢。

最佳答案

可能有几个根本原因:

  • 过时的 java 安装,不包含某些 Amazon 服务器的有效根证书
  • 无效的服务器端证书,不受任何有效颁发者信任

要从客户端调试到控制台,请将 -Djavax.net.debug=all 添加到命令行。页面Debugging SSL/TLS connections可以深入了解潜在的错误。

关于java - 亚马逊 : SSLHandshakeException happening intermittently,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12356290/

相关文章:

java - RxJava : Watch custom class

java - JDBC 准备好的语句不起作用

java - org.openqa.selenium.WebDriverException : Timed out waiting for driver server to start while initiating Chrome browser through Selenium

java - EJB2 - $Proxy0 无法转换为 com.TestEJB.TestEJBInterfaceRemote 错误

python - 从 AWS SES 中的 content-type=application/zip 和 base64 编码解析文本文件

java - 带有 Spring MVC 的谷歌应用引擎

javascript - 使用nodejs在dynamodb中的列表中搜索

json - 使用 AWS Step Functions 将整个 json 插入到 Dynamo DB 中的字段

postgresql - 无法通过主机名连接到 RDS

amazon-web-services - 如何解决错误 : "Argument names must not be quoted" in Terraform?