Java/Clojure中SSL的证书路径无法访问

9
我正在使用Clojure中的http-kit,当访问一个https://页面时,我会遇到unable to find valid certification path to requested target的错误提示。
:cause unable to find valid certification path to requested target
 :via
 [{:type javax.net.ssl.SSLHandshakeException
   :message General SSLEngine problem
   :at [sun.security.ssl.Handshaker checkThrown Handshaker.java 1375]}
  {:type javax.net.ssl.SSLHandshakeException
   :message General SSLEngine problem
   :at [sun.security.ssl.Alerts getSSLException Alerts.java 192]}
  {:type sun.security.validator.ValidatorException
   :message PKIX path building failed: sun.security.provider.certpath.SunCertPathBui
lderException: unable to find valid certification path to requested target
   :at [sun.security.validator.PKIXValidator doBuild PKIXValidator.java 387]}
  {:type sun.security.provider.certpath.SunCertPathBuilderException
   :message unable to find valid certification path to requested target
   :at [sun.security.provider.certpath.SunCertPathBuilder build SunCertPathBuilder.j
ava 145]}]

我尝试寻找一个简单的解决方案,发现有一些建议通过编程来解决。难道没有一种简单的方法吗?我只是想获取一个网页。在这种情况下,我甚至不关心安全性。我能让Java放松一下吗?
感谢您的建议。

你正在尝试访问哪个 HTTPS 页面? - Daniel Compton
@DanielCompton,这是https://www.gombaszog.sk/的网址。 - fifigyuri
我无法提供任何代码(因此不会将其发布为答案),但是最近有一篇关于在Clojure中使用客户端证书进行https请求的确切主题的文章,这可能会有所帮助。 - schaueho
1个回答

6

http/get接受一个"insecure?"选项:

@(http/get "http://gombaszog.sk" {:insecure? true})

3
这很有帮助,谢谢。我还发现了如何正确修复Java中的证书问题,并在Clojure中使其更简单。 对于{:insecure? true} 不可行的情况,请查看https://github.com/aphyr/less-awful-ssl和https://www.lvh.io/posts/https-requests-with-client-certificates-in-clojure.html。 - fifigyuri

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接