Getting fatal alert: handshake_failure issue on Java 7


Until yesterday I was using BETA_LINK for fetching the Legislators and committees, chambers and districts in Java-7 based project, but got some issue while calling the same this morning, below is the HTTP operation which I’m calling to fetching House/Senate Chamber of all state:


HttpResponse response =
.header(“Content-Type”, “application/graphql”)
.header(“X-API-KEY”, “xxxxxxxxxxxxxxxxxxxxxxxxxx”)
.header(“cache-control”, “no-cache”)
.body("{\njurisdictions {\nedges {\nnode {\nid\nname\norganizations(\nclassification:[“upper”, “lower”],\nfirst:2) {\nedges {\nnode {\nid\nname\nclassification\n} } } } } } }\n\n")


“errors”: [
“message”: “Must provide query string.”

Then later I found that the Base URL is changed PROD_HOST

While using Postman app, I’am able to get the response using same graphql, but from Java-7 based project i’m getting the handshake exception:

“message”: “ Received fatal alert: handshake_failure”,
“cause”: “[Ljava.lang.StackTraceElement;@3ed84b36

I have even tried with a self signed cert and various Jboss configurations
I’m using Maven project having Jboss-7 as server and Java 7.

Can anyone point out how can I resolve this issue?


Above post was not allowing me to post with below links, So adding here
BETA_LINK beta(dot)
PROD_LINK: openstates(dot)org/graphql


I think it’s supposed to be a .field("query", "{\njurisdictions {\nedges {\nnode {\nid\nname\norganizations(\nclassification:[“upper”, “lower”],\nfirst:2) {\nedges {\nnode {\nid\nname\nclassification\n} } } } } } }\n\n"), not a .body(...).


I don’t know unirest, and my Java is rusty, so I can’t speak directly to your problem. The query must be in a query member of the body json, one level down from where you have it. See

for a cURL example.


Also, it is likely that the reason you are getting a failure with the old URL in Java is that your code isn’t handling a 301 (Moved Permanently) response, but Postman is. I suspect you can see the full interaction somewhere in the Postman UI. It’s probably nothing to worry about - just use the new URL.


still getting the same issue.


Can you clarify? Are you seeing the “Must provide query string” or the “handshake_failure”, or both? What did you try?


I’m getting “handshake_failure” exception using NEW_URL in the Java program while calling CURL operation in it by using JAVA-7


Are you using the http or the https URL? If http, I’d try switching to https, that is:

In this case as well, using the wrong URL results in a redirect that you’re probably not handling.


You might consider emulating example 2 at with regard to body construction and headers Content-type and accept. Also, see doc at

I have never gotten Content-Type “application/graphql” to work, support for it is spotty, and it doesn’t support variables.


@Mradul what ended up happening for you with this?


This topic was automatically closed 70 days after the last reply. New replies are no longer allowed.