Exception while connecting to Jira soft. on my company's server via Java

Andrij November 9, 2017

Hi everyone :)

Im trying to get some data in JSON format using REST API of my company's Jira (ver. 6.4.13). This is for my Java application. 

I can normally get needed data using browser, but got exception when trying to do this via Java program.

Getting exceprion: "javax.net.ssl.SSLProtocolException: handshake alert:  unrecognized_name" at last line of next code:

//url in String
String urlString = "https://jira.***/rest/api/2/search?jql=project=***&fields=key";

//building http connection
URL url = new URL(urlString);

//open connection
HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection();

//set request method "GET"
urlConnection.setRequestMethod("GET");


//connect
urlConnection.connect();

 

Can anyone help me to break through this issue? I will thank you :)

 

1 answer

0 votes
Deyves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 9, 2017

Hi Andrij,

The error you're facing is the same scenario being described on this article: https://confluence.atlassian.com/kb/applinks-will-not-locate-https-host-755336476.html

Usually this is caused by a new security feature implemented in Java 7 update 4, named Server Name Indication (SNI). The error means that the server has received a server_name extension request, but it doesn't recognize the server's name.


As described on RFC-4366, the error message may be fatal and we've seen reports of cases where this message would appear in a SSL troubleshooting process, but not cause any roadblocks on the Application Links configuration. So, we're still unsure as to in which cases this would cause a failure.

As a workaround, you can disable the SNI feature at Jira.
To do that you'll need to add a new parameter at the Jira startup options by following the steps from this article: [JIRA's startup parameters|https://confluence.atlassian.com/jira/setting-properties-and-options-on-startup-120007.html]


The flag is: "-Djsse.enableSNIExtension=false"

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 9, 2017

Two minor technical points

1. the problem is a bug in Java that Oracle refuse to acknowledge

2. the fix is not a Jira thing, it applies to the JVM and hence the Tomcat that is running Jira.

Suggest an answer

Log in or Sign up to answer