Announcements
Hi,
I'm reading xml from URL and using that xml. But The URL started using TLS 1.2 so my code is not running.
TLS 1.2 has been added in server (i see it in regedit protocols)
My old code is below. I used webclient but OpenRead method no works. I hope use HttpClient but i dont know use that.
FreeTxt EDMReadXML(name _Url)
{
System.Net.WebClient webClient;
System.IO.Stream stream;
System.IO.StreamReader streamReader;
System.String line;
Notes rXML;
;
new InteropPermission(InteropKind::ClrInterop).assert();
webClient = new System.Net.WebClient();
stream = webClient.OpenRead(_Url);
streamReader = new System.IO.StreamReader(stream);
line = streamReader.ReadLine();
rXML = streamReader.ReadToEnd();
while(!System.String::IsNullOrEmpty(line))
{
line = streamReader.ReadLine();
}
streamReader.Close();
streamReader.Dispose();
stream.Close();
stream.Dispose();
return rXML;
}
Can you help me pls??
Hi,
my answer will surely be not complete since I'm struggling as well on this issue.
I've seen different approaches to this:
1. To force the usage of TLS 1.2 instead of older versions of the protocol (which seems the way you tried). I've tried it but doesn't seems to work. Perhaps your situation may be different, have you tried to explicity disable the other ones (e.g SSL 2.0 and TLS 1.1)?
2. To specify Ax to use NET Framework version 4.5 (since TLS 1.2 is only supported from 4.5 and above). This should be achieved by adding file ax32.exe.config in folder C:\Program Files (x86)\Microsoft Dynamics AX\50\Client\Bin of your terminal server and the same file in the folder C:\Program Files\Microsoft Dynamics AX\50\Server\[my aos instance name]\Bin of the AOS machine.
This file should contain the following
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
3. To cast the type of the SecurityProtocolType enum in order to force TLS1.2 value. See this link for reference (is in russian, but can be understood pretty well using automatic translation) axforum.info/.../showthread.php
4. To create a separate .NET 4.5 process (see Martin's last reply). Unfortunately I don't have necessary knowledge to find a way to do this and steps to be taken are not specified in this thread...
www.dynamicsuser.net/.../64961
Needless to say I've tried them all but none of them worked for me. Let's keep in touch in case any of us finds a solution.
Thanks
André Arnaud de Cal...
294,165
Super User 2025 Season 1
Martin Dráb
232,968
Most Valuable Professional
nmaenpaa
101,158
Moderator