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.
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.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
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)
Member
249 Points
1064 Posts
TLS support mutliple protocols
Oct 08, 2018 07:24 PM|icm63|LINK
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.
Star
9831 Points
3120 Posts
Re: TLS support mutliple protocols
Oct 09, 2018 05:25 AM|Brando ZWZ|LINK
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.
Best Regards,
Brando
Member
249 Points
1064 Posts
Re: TLS support mutliple protocols
Oct 09, 2018 04:41 PM|icm63|LINK
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)