gpt4 book ai didi

java - 使用 Java 的 Jira Rest API

转载 作者:太空宇宙 更新时间:2023-11-04 10:07:10 26 4
gpt4 key购买 nike

我正在尝试使用 Jira Rest Api 调用 Jira。创建连接时出现以下错误。

Jira URL:https://jira.dv.xxxxx.com/rest/api/2/search?&fields=status,projectkey&jql=clientId%3DTABC+and+taskid%3DTABC-2

Java 代码:

public static HttpURLConnection getJiraClientConnection(final URL url) throws IOException{
PropertiesManager prMgr = PropertiesManager.getInstance();
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod(CommonConstants.GET);
conn.setRequestProperty(CommonConstants.ACCEPT, CommonConstants.ACCEPTTYPE);
conn.setRequestProperty(CommonConstants.AUTHORIZATION, CommonConstants.BASIC + prMgr.getPassword());
}

错误:

        javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1979)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1086)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)

我用谷歌搜索了这个错误,但没有得到任何正确的解决方案。

提前谢谢您!

最佳答案

来自另一位用户,“此错误意味着您的 java 信任库没有您尝试连接的服务的 ssl 证书。” javax.net.ssl.SSLHandshakeException 。这里还有更深入的故障排除指南 Received fatal alert: handshake_failure through SSLHandshakeException

关于java - 使用 Java 的 Jira Rest API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52779757/

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