gpt4 book ai didi

java - 使用此代码在 tomcat 上使用 SSL 时出现问题

转载 作者:太空宇宙 更新时间:2023-11-03 15:06:56 25 4
gpt4 key购买 nike

我想知道这个错误是什么意思:javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求的目标 null 的有效证书路径/p>

当我尝试使用此状态时出现此错误:

private HttpState setcookies(String msg){
HttpState state = new HttpState();
String[] splited;
String authToken=null;
String tokenSecret=null;
splited = msg.split(" ");
authToken=splited[1];
tokenSecret=splited[2];
org.apache.commons.httpclient.Cookie cookie = new org.apache.commons.httpclient.Cookie("winter.servebeer.com", EXTCOOKIE+"accessToken", authToken);
cookie.setPath("/OfeliaP");
state.addCookie(cookie);
cookie=new org.apache.commons.httpclient.Cookie("winter.servebeer.com", EXTCOOKIE+"tokenSecret", tokenSecret);
cookie.setPath("/OfeliaP");
state.addCookie(cookie);
return state;
}

最佳答案

我遇到过这样的事情。我怀疑问题是您已将服务器配置为以错误的顺序显示证书链。 Web 浏览器通常不关心,但 SSL/TLS 的 Java 实现要求链中的证书顺序正确。

关于java - 使用此代码在 tomcat 上使用 SSL 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5529909/

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