-1

Can we write a C# code to automatic tick "Use TLS 1.2"?

This is manual step:- Go into Internet Options > Advanced then down to the Security section, and tick the box for "Use TLS 1.2".

Is there any way to tick it programmatically in C#.

Yamuna
  • 11
  • 5
  • Most of those are Reg key. you can simply modify them with win32 or executing them in a command shell. – xdtTransform May 23 '19 at 11:49
  • https://support.microsoft.com/en-us/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-wi , here is the falg you looking for. Now it's a dupe of "How to modify registery key in C#"(e.g: [1](https://stackoverflow.com/questions/8816178/modifying-the-registry-key-value) of many dupe target) or "How to execute cmd command in c#"(e.g:[1](https://stackoverflow.com/questions/1469764/run-command-prompt-commands) of many dupe target) – xdtTransform May 23 '19 at 11:51
  • Btw some of the reg key name may depends on the Windows version or patch. and may differ from the one in the MSDN. – xdtTransform May 23 '19 at 11:57

2 Answers2

0

Use UI Automation Test Library from microsoft. It's used for testing purpose but it can work here. https://learn.microsoft.com/en-us/windows/desktop/winauto/ui-automation-test-library

0

Most of Internet option are Reg key. You can simply modify them with win32 or executing them in a command shell.

The key is specified in this MSDN article 1. and 2

Now either "How to modify registery key in C#" or "How to execute cmd command in c#".

xdtTransform
  • 1,986
  • 14
  • 34