Search code examples
tls1.2myob

How do I determine whether I need to upgrade the dot net framework given change to TLS version?


MYOB has advised that as of 30th September 2018 the MYOB API will no longer accept connections using TLS1.0

I have a Winforms application which connects to MYOB Accountright via the API using the SDK

I am wondering if there are any specific changes that I need to make to an application that I released 2 years ago.

I asked on the developer forum and was told that if my code uses TLS1.0 I need to change it.

From this question about determining the dot net framework I am thinking that I need to check the framework MYOB.AccountRight.SDK.dll uses. Looking in my project I see that it is v4.0.30319

I opened MYOB.AccountRight.SDK.dll in notepad and saw NETFramework,Version=v4.5

From Stan Tarnovskly's blog I see

.NET 4.5. TLS 1.2 is supported, but it’s not a default protocol. You need to opt-in to use it. The following code will make TLS 1.2 default, make sure to execute it before making a connection to secured resource: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12


Solution

  • You don't want to be using TLS 1.0 or 1.1 these days.

    This doc has some best practices and also several references to the upgrade path you should be looking at: https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls

    We recommend that you:

    • Target .NET Framework 4.7 or later versions on your apps.
    • Target .NET Framework 4.7.1 or later versions on your WCF apps.
    • Do not specify the TLS version. Configure your code to let the OS decide on the TLS version.
    • Perform a thorough code audit to verify you're not specifying a TLS or SSL version.