gpt4 book ai didi

java - 无法从 Java 找到到所请求目标的有效证书路径,但可以通过浏览器登录

转载 作者:行者123 更新时间:2023-12-01 18:22:47 26 4
gpt4 key购买 nike

我遇到异常:

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

但是我可以通过浏览器成功登录该页面。这是否意味着我的 cacerts 文件中缺少一些证书?我知道如何将 .cer 文件添加到 cacerts 中,但如何从网站下载正确的 .cer 文件?

最佳答案

我做了@Karthikeyan 在链接中建议的事情:

  1. 使用openssl命令检查服务器上的证书
  2. 复制

    -----BEGIN CERTIFICATE-----
    < Certificate content as fetched by the command line.
    Don't change this content, only remove what is before
    and after the BEGIN CERTIFICATE and END CERTIFICATE.
    That's what your Sed command is doing for you :-) >
    -----END CERTIFICATE-----

    进入文件

  3. 使用 keytool -import 命令将此带有证书的文件添加到 java 信任库

关于java - 无法从 Java 找到到所请求目标的有效证书路径,但可以通过浏览器登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60277218/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com