web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

System.Net.WebException: 'The request was aborted: Could not create SSL/TLS secure channel.'

(0) ShareShare
ReportReport
Posted on by 2
Hello Community,
 
I'm trying to implement a web api call in X++ (D365FO).
Unfortunately, I'm facing an issue during the execution of the GetReponse() method below.
 
Extract of X++ Code 

      str user = /xxxxx/;
      str pass = /xxxxxxxxxxxxxxxxxxx/;
      System.Text.Encoding encoding = System.Text.Encoding::UTF8;
   System.Byte[] bytes = encoding.GetBytes(user + /:/ + pass);
   System.String base64 = System.Convert::ToBase64String(bytes);

   System.String headerKey = /Authorization/;
   System.String headerValue = /Basic / + base64;
   request = System.Net.WebRequest::Create(API URL);

   System.Net.WebHeaderCollection headers = request.Headers;
   request.set_Headers(headers);
   request.Method = /GET/;

      response = request.GetResponse();

Error Message during the execution of GetResponse() Method
The request was aborted: Could not create SSL/TLS secure channel.
 
Investigating in this forum, it seems that some people faced this issue in the past, but I didn't find a clear fix.
Can someone please help ?
 
Thanks
 
Regards,

Samir
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,679 Most Valuable Professional on at
    System.Net.WebException: 'The request was aborted: Could not create SSL/TLS secure channel.'
    Try changing the security protocol to TLS 1.2:
    System.Net.ServicePointManager::SecurityProtocol = System.Net.SecurityProtocolType::Tls12;
     
     
     
  • Community member Profile Picture
    2 on at
    System.Net.WebException: 'The request was aborted: Could not create SSL/TLS secure channel.'
    Hi Martin,
     
    Thx for your feedback.
    I've already tried this but it didn't work.
     
    Regards,
     
    Samir
  • Suggested answer
    Kevin Xia Profile Picture
    Microsoft Employee on at
    System.Net.WebException: 'The request was aborted: Could not create SSL/TLS secure channel.'
    Hi,
    You can check out this old thread where the questioner has a similar question to yours: "The request was aborted: Could not create SSL/TLS secure channel." On API Call (dynamics.com). It comes out to be the ciphers that were not configured on D365 FnO VMs
    Best regards,
    Kevin

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans