【问题标题】:getting SSL handshake exception while generating Pdf from Html in java在 java 中从 Html 生成 Pdf 时出现 SSL 握手异常
【发布时间】:2012-08-28 04:32:00
【问题描述】:

在我的网络应用程序中有一个从 html 页面生成 pdf 的选项。执行此操作时会出现以下异常。在这个 html 页面中,我们通过 https 访问 css 文件。但是,我可以通过 https 成功访问 Web 应用程序。

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

Caused by: sun.security.validator.ValidatorException: 
           PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: 
           unable to find valid certification path to requested target

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: 
           unable to find valid certification path to requested target

请提供您的宝贵建议。 谢谢!!

【问题讨论】:

标签: java web ssl-certificate itext sslhandshakeexception


【解决方案1】:

您的浏览器使用证书存储,并检查您正在访问的站点的公共证书是否可用。如果是这样,您访问该网站就没有问题了。

Java 也会检查其证书存储,但它与您的浏览器使用的不同。这在the white paper on digital signatures 中有解释 在文档中搜索 PKIX,您会发现发生了什么。

【讨论】:

  • 感谢布鲁诺分享这么好的链接。我的 Web 应用程序部署在 Linux 机器上。您知道如何在 jre 的密钥库上添加证书吗?
  • 在 Linux 或 Windows 上工作并不重要。您需要 JDK 附带的 keytool 应用程序。如果无法在服务器上安装,只需复制 cacerts 文件,在您想要的任何机器上添加证书,然后将现有的 cacerts 文件替换为更新后的文件。
  • 是的,你是对的。最后,我成功创建和安装了自签名证书,但仍然无法在 [req_extensions] 下添加 StandardAltNames。你有什么主意吗?我实际上看到了与同一主题相关的一个问题,由您回答,但它对我不起作用。
猜你喜欢
  • 1970-01-01
  • 2011-04-16
  • 1970-01-01
  • 1970-01-01
  • 2014-02-20
  • 2014-05-11
  • 1970-01-01
  • 2015-07-30
  • 1970-01-01
相关资源
最近更新 更多