locked
TLS support mutliple protocols RRS feed

  • Question

  • User-1668014665 posted

    I see this code works in asp 4.0

    System.Net.ServicePointManager.SecurityProtocol =
    System.Net.SecurityProtocolType.Ssl3
    | System.Net.SecurityProtocolType.Tls12
    | SecurityProtocolType.Tls11
    | SecurityProtocolType.Tls;

    ref: https://docs.microsoft.com/en-us/dotnet/api/system.security.authentication.sslprotocols?redirectedfrom=MSDN&view=netframework-4.7.2

    QUESTION: Would this work in asp 2.0 ?? Is the 'or' ok or is there a better way?

    System.Net.ServicePointManager.SecurityProtocol = DirectCast(3072, System.Net.SecurityProtocolType) Or DirectCast(768, System.Net.SecurityProtocolType) Or DirectCast(192, System.Net.SecurityProtocolType) Or DirectCast(48, System.Net.SecurityProtocolType)

    I use HTTPSWebRequest to get data via RESP API, and now different providers have different TLS for different URLS.  So I need to allow all different type protocols to allow all of them to work. I have no idea how to allow different URLs to use different TLS protocols on request in asp 2.0 .

    NOTE: My asp net 2.0 application is massive and I have not got the time to upgrade.

    Monday, October 8, 2018 7:24 PM

Answers

All replies

  • User283571144 posted

    Hi icm63,

    According to your description, if you want to get TLS 1.2 working for .NET 2.0 on Server 2008 R2 you need this HOTFIX:

    https://support.microsoft.com/en-us/help/3154518/support-for-tls-system-default-versions-included-in-the-net-framework 

    It references 3.5.1 framework but ALSO works for 2.0 framework. Once the hotfix is installed you can either make registry changes on the server as indicated OR make code changes in your app to reference TLS 1.2 directly.

     ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 9, 2018 5:25 AM
  • User-1668014665 posted

    For other using vb.net, asp.net 2.0, MS SQL server 2008 R2 this code worked fine in global class in application_start

    This code activates all types of TLS and SSL3

    System.Net.ServicePointManager.SecurityProtocol = DirectCast(3072, System.Net.SecurityProtocolType) Or DirectCast(768, System.Net.SecurityProtocolType) Or DirectCast(192, System.Net.SecurityProtocolType) Or DirectCast(48, System.Net.SecurityProtocolType)

    Tuesday, October 9, 2018 4:41 PM