
Hi NAV Experts,
Version : NAV2017
I am facing SSL/TLS connection issue when i am trying to make a post request to an API.
Below are some scenarios in which its behaving strange.
1. After searching the issue on blogs and community forms, i got to know that i have to add SecurityProtocol to the httpWebRequest. So for that i added two functions from later versions of NAV into NAV2017(since nav 2017 does not have that functions in codeunit 1297).
As suggested in forms we should use Tsl12 to resolve this issue. But it did not fix my issue then i added Tls10 by adding only Tls protocol like below.
It worked for me on my machine.
AddSecurityProtocolTls12()
SecurityProtocol := Convert.ToInt32(SecurityProtocolType.Tls);
AddSecurityProtocol(SecurityProtocol);
LOCAL AddSecurityProtocol(SecurityProtocol : Integer)
CurrentSecurityProtocol := Convert.ToInt32(ServicePointManager.SecurityProtocol);
IF TypeHelper.BitwiseAnd(CurrentSecurityProtocol,SecurityProtocol) <> SecurityProtocol THEN BEGIN
ServicePointManager.Expect100Continue := TRUE;
ServicePointManager.SecurityProtocol := TypeHelper.BitwiseOr(CurrentSecurityProtocol,SecurityProtocol);
END;
2. When i moved this whole solution which is doing this POST operation on API on another system. Again i faced same SSL/TLS issue on that system. Even everything is same.
Then not sure how, but just tweaking code like making Tls10 to Tls12 and vice versa. On some point it worked as usual.
Now the issue is that , i am not sure what i need to do if i move this whole solution to another system and then its show the same error again.
Any help would be highly appreciated!!!
Thanks
SUD
Hello,
You must be on a specific build of Dynamics NAV 2017:
Earlier CU's / releases won't have that support for the key.
Thanks.