Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

C# Jira SDK: The request was aborted: Could not create SSL/TLS secure channel

Jake See July 28, 2019

I had been using I am using Atlassian.SDK C# v10.3.0 for months until end Jun without problems. Then, I started getting the "Could not create SSL/TLS secure channel" error, so I updated to Atlassian.SDK C# v10.6.0, and added TLS1.2 before calling CreateRestClient:

// server requires TLS1.2 due to vulnerability in older protocols
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
Jira = Jira.CreateRestClient("https://company.atlassian.net", txtUsername.Text, txtPassword.Text);

 And it was able to to connect properly without the error, but then next when I tried to call

var user = Jira.Users.GetUserAsync("admin");
user.Wait(); 

I get an exception with InnerException:

{"Response Content: <html>\n\n<head>\n \n\n\n\n\n\n <script id=\"@atlassian/spa-iframe-script\" type=\"text/javascript\">\n (function() {\n var spaIframeRegex = /([&?]spaIframe=true*$|spaIframe=true&|[?&]spaIframe=true(?=#))/;\n ...

What is happening and how can I resolve it?

1 answer

1 accepted

0 votes
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 29, 2019

Hey Jake,

In addition to dropping TLS 1.0 and 1.1, we've also recently stopped supporting passwords over basic authentication. This change was enforced on all accounts near the end of June, so I think this may be what you're running into.

The short answer is that you'll need to generate an API token at https://id.atlassian.com/manage/api-tokens and drop that in where you've currently got your password stored. The great thing about tokens is that you can assign unique ones per-application, and you can revoke them in the future without having to change your account password.

More details are on this KB article, but for your convenience I've copied over the setup instructions:

  1. Log in to https://id.atlassian.com/manage/api-tokens.
  2. Click Create API token.
  3. From the dialog that appears, enter a memorable and concise Label for your token and click Create.
  4. Click Copy to clipboard, then paste the token to your script, or elsewhere to save:

Note:

  • For security reasons it isn't possible to view the token after closing the creation dialog; if necessary, create a new token.
  • You should store the token securely, just as for any password.

 

Cheers,
Daniel

Jake See July 29, 2019

Thanks Daniel. This solves my problem. We need to update the documentation! Make it a community wiki or something so that we can save people from the panick.

S
Contributor
October 23, 2020

@Jake See If you can - please share the code snippet of how did you or what changes your made to establish connection with JSD using C#

navneet sharma
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 16, 2021

Hi Daniel Eads  we are facing the same SSL/TSL issue, after the JIRA patch update  8.13.1 to  8.13.4, while requesting from C# http request.

We also added security protocol as suggested most of blogs.   

Could you/anyone, Pls guide us to resolve the issue. if you have working C# code snippet ,pls share with us.

"System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;"

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 19, 2021

Hi @navneet sharma , an upgrade to Jira Server shouldn't affect the TLS configuration or cipher suites involved. The settings for TLS termination are in Jira's server.xml file if it's serving HTTPS directly, or with the reverse proxy application if you are fronting Jira Server with a reverse proxy. You would need to check with one of your server administrators to get a list of enabled protocols and ciphers - this is going to vary by environment for Server.

Is it possible you're trying to connect to Jira Cloud? We did recently change the cipher suites configuration for Atlassian Cloud by disabling some less secure ciphers, as outlined in this announcement.

I'd recommend taking a peek at this Microsoft thread for further investigation. Just enabling TLS 1.2 in your code might not be enough. Depending on the framework version or operating system you're running it on, you might need to enable things in Windows directly (on the machine running your C# code).

Suggest an answer

Log in or Sign up to answer