Search code examples
c#visual-studiosslwindows-7

Unable to create SSL/TLS secure channel


Due to business needs, we need to use SSL/TLS secure channels, which has a general consensus on security. But the same way, on my windows10 everything works as expected. But it doesn't work on windows7. And it often reminds that the SSL/TLS secure channel cannot be created.

I am using VS2022. And the computer is also installed. Net framework 4.7. The system of the target computer is win7 32-bit system

And using the following code still doesn't work:

ServicePointManager. Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult);

Is it because of compatibility issues with some software?


Solution

  • I suggest you try the following steps:

    1. The firewall settings or proxy server settings of your target computer are incorrectly configured. For specific solutions, please refer to Unable to create SSL/TLS secure channel error

    2. It is recommended that you check whether the TLS version is higher. Generally, .net framework seems to have better compatibility with tls1.2. You can view the tls version by capturing packets. Of course, please try to use the new version of the packet capture tool, otherwise it can only be displayed to 1.2.

    3. Whether the ssl cipher suite sequence is enabled, if not please enable it.

    4. There may indeed be a problem with the computer's operating environment. For example, you can replace other versions of .net framework on a win7 computer.