Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Service Point Manager NAV 2009

(0) ShareShare
ReportReport
Posted on by 344

Hi All,

I am trying to send an API request from NAV 2009 but I am facing an error 

This message is for C/AL developers: GetResponse member call failed: Request aborted: Unable to create SSL/TLS secure channel.

I tried to add the ServicePointManager but couldnt add as the .net version is quite old.

Then I tried an alternative but still the problem occur

3072 = Tls12

Any idea about how to fix that?

pastedimage1661764547747v2.png

  • Ramiz Profile Picture
    Ramiz 344 on at
    RE: Service Point Manager NAV 2009

    Hi yzhums 

    Thanks for your answer. After many hit and tries finally this worked for me but I end up in another problem. I will explain. I am passing a certificate to the request. 

    //ServicePointManager.SecurityProtocol := SecurityProtocolType.Tls12;
    ServicePointManager.Expect100Continue := TRUE;
    ServicePointManager.SecurityProtocol := 3072;
    ServicePointManager.DefaultConnectionLimit := 9999;
    
    HttpWebRequest := HttpWebRequest.Create(UrlL);
    HttpWebRequest.Method := 'POST';
    HttpWebRequest.ClientCertificates.Add(Certificate);
    HttpWebRequest.ContentType := 'application/xml';
    RequestStr := HttpWebRequest.GetRequestStream();
    
    StreamWriter := StreamWriter.StreamWriter(RequestStr,Encoding.ASCII);StreamWriter.Write(XMLResponse.InnerXml);
    StreamWriter.Flush;
    StreamWriter.Close;
    StreamWriter.Dispose;
    
    HttpWebResponse := HttpWebRequest.GetResponse();

    Everything is working fine as long as I am in the server but when I try to process the request from the clients computer I get the error of .net assembly. I realized I should enable
    RunasClient = true  but when I enable that I get error on the COPYSTREAM. Something like NAV Instream to DotNet not possible.

    Any suggestions?

    SupplySetupTBL.ZAM_Certificate.CREATEINSTREAM(_InStream);
    MemoryStreamL := MemoryStreamL.MemoryStream;
    COPYSTREAM(MemoryStreamL,_InStream);
    Certificate := Certificate.X509Certificate2(MemoryStreamL.ToArray,InformImmediateSupplySetupTBL.ZAM_Password);

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 74,036 Super User 2024 Season 2 on at
  • Ramiz Profile Picture
    Ramiz 344 on at
    RE: Service Point Manager NAV 2009

    Hi Marco Mels ,

    Thanks for your answer but the client doesn't want to upgrade that's why trying to find a solution for 2009. Not sure whether its possible or not.

  • Marco Mels Profile Picture
    Marco Mels on at
    RE: Service Point Manager NAV 2009

    Hello,

    I think you need to upgrade first to get it to work:

    cloudblogs.microsoft.com/.../

    Thank you.

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans