1

In my application i want to check which Security Protocol the client supports. I have the newest .Net Version.

My Idea is to set the SecurityProtocol to the SecurityProtocolType Tls1.2 like:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

My question is, if the client doesn´t support TLS1.2 does the ServicePointManager(SecurityProtocol) throws an exception that this version isn´t supported?

1 Answers1

0

Yes, you should get a NotSupportedException

In some testing I have done in the past, you would see

Unhandled Exception: System.NotSupportedException: The requested security protocol is not supported. at System.Net.ServicePointManager.set_SecurityProtocol(SecurityProtocolType value)

Dai Bok
  • 3,451
  • 2
  • 53
  • 70
  • thanks for your fast answer! so if the client turn off the "use TLS1.2" in the internet option the exception is thrown? – escalationLevel Feb 28 '17 at 10:05
  • Yes, that should be the case. It also depends on OS, I ause you using windows 7 right? – Dai Bok Feb 28 '17 at 10:11
  • no, i use Windows 10, but some user are using win7 and for them i want a little tool which checks if they support TLS 1.2 – escalationLevel Feb 28 '17 at 10:13
  • if they have .net.4.5 installed, then TLS 1.2. should be supported. you will have problems with users of windows vista/windows XP – Dai Bok Feb 28 '17 at 10:14
  • The Application doesn´t run on vista/XP so that is no problem :) the application was compiled with .net 4.6 so the only "Problem" is the Client if he doesn´t enabled TLS1.2 in the internet Option isn´t it? – escalationLevel Feb 28 '17 at 10:21
  • Yes, by default it is not enabled, so you may need to make changes.There are plenty of resource to find out how to turn tls1.2 on for win7/win8+ https://support.microsoft.com/en-gb/help/3140245/update-to-enable-tls-1.1-and-tls-1.2-as-a-default-secure-protocols-in-winhttp-in-windows – Dai Bok Feb 28 '17 at 10:32
  • if this answers your question, please accept my answer – Dai Bok Feb 28 '17 at 10:33