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"



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


1 answer

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
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

809 views 3 9
Read article

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