C# Jira API {"The request was aborted: Could not create SSL/TLS secure channel."}

  • Thread starter Thread starter StSingh
  • Start date Start date
S

StSingh

Guest
Hi,

I'm using VS - 2015 and developing an office plugin for Jira Service desk using their API's

Since this is my first go at JSD API's, I have tried to keep things very simple.


Goal - Authenticate and get the Queue data

Error: {"The request was aborted: Could not create SSL/TLS secure channel."}

My code so far...

Reference 1

Reference 2


Ref 3

string jsonResponse = null;

urlJira = "https://projectName.net/rest/servicedeskapi/servicedesk/1000001";

WebRequest requestIssueList = WebRequest.Create(urlJira) as HttpWebRequest;
HttpWebResponse responseJiraList = null;
requestIssueList.Method = "GET";
requestIssueList.ContentType = "application/json";

ServicePointManager.Expect100Continue = true;

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls
| SecurityProtocolType.Ssl3;

requestIssueList.Headers.Add("Authorization", "Basic " + GetEncodedCredentials(strUserName, apiToken));
// byte[] data = Encoding.UTF8.GetBytes(JsonString);

responseJiraList = (HttpWebResponse)requestIssueList.GetResponse();
using (Stream stream = responseJiraList.GetResponseStream())
{
StreamReader str = new StreamReader(stream);
jsonResponse = str.ReadToEnd();
str.Close();
}



Any help is highly appreciated ...

Continue reading...
 
Back
Top