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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

API Call from X++/C# failing with "Request was aborted could not create ssl/tls secure channel"

(0) ShareShare
ReportReport
Posted on by 50

I am trying to send a GET/POST call to an API with API key authentication. It fails while getting a response with the error "Request was aborted could not create ssl/tls secure channel ". I have tried all the possible changes provided in the blogs like assigning Security protocol type to TLS1.2 to the security point manager, Enabling TLS1.1,1.2 from the settings, adding it to the trusted site, etc.

Any help will be appreciated.

I have the same question (0)
  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    Can you run the job on the url and show us result

    sites.google.com/.../tlsversionindynamicsaxnetinteropinx

    And can you try samething on AOS server machine

  • ShruthiKrishnaswamy95 Profile Picture
    50 on at

    Hi Ergun,

    3125.Screenshot-_2800_7_2900_.png

    This is what I get when I try from my machine. Also I ran the code that is there in the link you provided, TLS12 is enabled which I have added before the CREATE statement.

    System.Net.ServicePointManager::set_Expect100Continue(true);

    System.Net.ServicePointManager::set_SecurityProtocol(System.Net.SecurityProtocolType::Tls12);

    clrObj = System.Net.WebRequest::Create(url);

    Regards,

    Shruthi

  • ergun sahin Profile Picture
    8,826 Moderator on at

    Nope I didn't mean add ServicePointManager to code. Link have a job which is shown ServicePointManager 's status(value).

    What I want learn is server's and local's status (and lastly ServicePointManager  a global value(appDomain) don't change it If you not sure)

    static void CheckEnviornmentSecurityProtocol(Args _args)
    {
        int i;
        boolean ssl3Enabled,tlsEnabled,tls11Enabled,tls12Enabled;
    
        ;
        i = System.Net.ServicePointManager::get_SecurityProtocol();
    
        ssl3Enabled = i & enum2int(System.Net.SecurityProtocolType::Ssl3);
        tlsEnabled = i & enum2int(System.Net.SecurityProtocolType::Tls);
        tls11Enabled = i & enum2int(System.Net.SecurityProtocolType::Tls11);
        tls12Enabled = i & enum2int(System.Net.SecurityProtocolType::Tls12);
    
        info(strFmt("'%1' enabled: '%2'",
                'ssl3',            
                ssl3Enabled));
        info(strFmt("'%1' enabled: '%2'",
                'tls1',            
                tlsEnabled));
        info(strFmt("'%1' enabled: '%2'",
                'tls11',            
                tls11Enabled));
        info(strFmt("'%1' enabled: '%2'",
                'tls12',            
                tls12Enabled));
    }

  • ShruthiKrishnaswamy95 Profile Picture
    50 on at

    Thats right, I ran the job that is provided in the link which shows TLS12 as enabled.

  • ergun sahin Profile Picture
    8,826 Moderator on at

    Do you have a firewall or did you changed registry. What OP system you have (From explorer image I can see your status is not code related)

  • ShruthiKrishnaswamy95 Profile Picture
    50 on at

    No, I did not change registry too. Its a regular 2 tier cloud machine deployed from LCS.

  • ergun sahin Profile Picture
    8,826 Moderator on at

    The code can give this error for many different reasons. The first ones that come to my mind are .Net framework, certificate, Ciphers, WebRequest.Timeout = 0 ...

    However, you can't even see it from explorer. You have a different problem. You can check out the link below

    stackoverflow.com/.../the-request-was-aborted-could-not-create-ssl-tls-secure-channel

  • ShruthiKrishnaswamy95 Profile Picture
    50 on at

    I have already tried the coding changes suggested in the link. It did not help.

  • ergun sahin Profile Picture
    8,826 Moderator on at

    Nope, I don't think you have a code related problem. Operating system, security, registry etc.

    Did you try from a different environment, maybe from local (web browser or Visual studio)

  • ShruthiKrishnaswamy95 Profile Picture
    50 on at

    From my local system, I am getting a response through the URL.

    7120.Screenshot-_2800_26_2900_.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 692

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 454 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 311 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans