Announcements
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?
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);
Hi, hope the following will helps.
https://forum.mibuso.com/discussion/73329/post-request-fails-could-not-create-ssl-tls-secure-channel
https://forum.mibuso.com/discussion/67271/security-protocol-tls-1-2-in-dynamics-nav-2013
Thanks.
ZHU
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.
Hello,
I think you need to upgrade first to get it to work:
Thank you.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156