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

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

This widget could not be displayed.

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"

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

215 views 3 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you