Skip to main content

Notifications

Microsoft Dynamics NAV forum
Suggested answer

Service Point Manager NAV 2009

Posted on by 176

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 176 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 69,510 Super User 2024 Season 2 on at
  • Ramiz Profile Picture
    Ramiz 176 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

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans