Security protocol TLS 1.2 in Dynamics NAV 2013

MrJanMrJan Member Posts: 2
Hi out there!

I am trying to increase a web requests security protocol in order to access a web service which is requiring TLS 1.2.
My default SSL is not accepted.

The request is send from Dynamics NAV 2013 (7.00).

I have of course searched for a solution to this problem elsewhere. One single line should be enough:
ServicePointManager.SecurityProtocol := 3072;

This however does not grant me access to the server.


HttpWebRequest := WebRequest.Create(txtURLiLG);

ServicePointManager.SecurityProtocol := 3072; // 3072 = Tls12 (TLS 1.2)

HttpWebRequest.Timeout := 600000; // 10 minutes
HttpWebRequest.ReadWriteTimeout := 600000; // 10 minutes

HttpWebRequest.ContentType := 'text/xml;charset=utf-8';
HttpWebRequest.Method := 'POST';
SystemTextUTF8Encoding := SystemTextUTF8Encoding.UTF8Encoding();
Bytes := SystemTextUTF8Encoding.GetBytes(XMLDoc.InnerXml);
HttpWebRequest.ContentLength := Bytes.Length;
RequestStream := HttpWebRequest.GetRequestStream();
RequestStream.Write(Bytes, 0, Bytes.Length);
RequestStream.Close;


Do any of you have a hint setting securety protocol to TLS 1.2 in Dynamics NAV?

Thanks.

Best regards
Jan

Answers

  • archer89archer89 Member Posts: 337
    check if .net framework 4.5 is installed. if not install it.
    .net 4.0 does not support TLS 1.2.
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
  • MrJanMrJan Member Posts: 2
    Thanks archer89.
    The .net framework 4.5 is already installed.

    Best regards
    Jan
  • mikhaelmikhael Member Posts: 19
    Hi,

    I am currently facing same issue, have you any thought how to change the security protocol?
  • okioki Member Posts: 46
    Is there a solution yet? Having same issue with NAV 2016
  • sheikhjksheikhjk Member Posts: 1
    Hello Guys i have a problem my system during i start any designing software then pop box showing me please upgrade framework please tell how can i fix it
  • AgannaloAgannalo Member Posts: 12
    edited 2018-07-18
    @MrJan Try this:
    ServicePointManager=System.Net.ServicePointManager
    SecurityProtocolType=System.Net.SecurityProtocolType
    ServicePointManager.SecurityProtocol := SecurityProtocolType.Tls12;
    
  • okioki Member Posts: 46
    Hi Agannalo,

    I need a solution for Dynamics NAV 2016. The members you're showing above are not available as DotNet-Types to create variables. .NET Framework 4.5 is installed.

    Oki
  • AgannaloAgannalo Member Posts: 12
    oki wrote: »
    Hi Agannalo,

    I need a solution for Dynamics NAV 2016. The members you're showing above are not available as DotNet-Types to create variables. .NET Framework 4.5 is installed.

    Oki

    Actually i used this on 2016 ver 9.00.49832 with framework 4.0.
  • cvanderpoelcvanderpoel Member Posts: 9
    Hi,

    If your service tier is running on windows 2008 r2 you could look at this


    Chris
  • hrishihrishi Member Posts: 21
    Thanks Agannalo, it works for me..
  • AitorEGAitorEG Member Posts: 342
    Hello,

    Did you get any solution? I expose here my issues..

    https://forum.mibuso.com/discussion/76151/problem-using-tls12-13-for-connection-with-webservice#latest

    I've followed the tips given in this post, but I still getting the error shown in my post...
  • urpokurpok Member Posts: 23
    edited 2021-10-29
    Sorry to wake old thread, but please find below resolution (As Agannalo previously stated). This worked for me with NAV2017. I just hope the customers would update at last.

    First create a global .NET variable for System.Net.ServicePointManager, and then call it with
    ServicePointManager.SecurityProtocol := SecurityProtocolType.Tls12;
    

    8k7qxw8awjcz.png

    "There is no spoon."
    --Matrix

    https://navurpo.blogspot.com/?view=classic
  • weneedweneed Member Posts: 82
    Cannot find System.Net.ServicePointManager in .NET variable. I've 4.8 .NET framework installed..
  • AluanAluan Member Posts: 164
    Hello weneed,
    you can find it in the System Assembly.

    See here:
    https://docs.microsoft.com/de-de/dotnet/api/system.net.servicepointmanager?view=netframework-4.8

    In the top left Corner you can change the Version.

    If you input the following string into the subtype it should work:
    System.Net.ServicePointManager.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    

  • weneedweneed Member Posts: 82
    Thanks so much!!
Sign In or Register to comment.