1

Am trying to calling Jira using Jira Rest Api. While creating a connection am getting below error.

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

Java Code:

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());
}

Error:

        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)

I googled for this error, I was not getting any correct solution for this.

Thank you in advance!

Bharathiraja S
  • 591
  • 1
  • 8
  • 19
  • This answer has some options that may help: https://stackoverflow.com/questions/6353849/received-fatal-alert-handshake-failure-through-sslhandshakeexception I would first check your SSL version compatibility and certificate trust path. – Jeremy Oct 12 '18 at 12:49

1 Answers1

0

From another user, "This error means your java truststore doesnt have ssl certificate for service you are trying to connect." javax.net.ssl.SSLHandshakeException. And a more in depth trouble shooting guide here Received fatal alert: handshake_failure through SSLHandshakeException