I have been having a frustrating issue for the past couple of weeks that I have been unable to solve. I am working on a project in Unity2018.4.4f1, where we are making use of the .Net4.X scripting backend. We have code in the project that makes use of the standard .Net HttpWebRequest class. This has been working fine for me up until a couple of weeks ago. However since then I have been receiving the following eception when attempting to make use of HttpWebRequests:
Remote Web Request failed with web exception: System.Net.WebException: Error: ConnectFailure (TLS Support not available.) —> System.NotSupportedException: TLS Support not available. —> System.NotSupportedException: No such TLS Provider: `legacy’.
Around the time that this started happening I had separately installed Mono for Windows and my belief is that that has somehow caused this issue. My guess is that it has in some way modified the Windows Registry or set an environment variable that is now causing issues. Believing the standalone Mono installation to be the cause of my issue I have since uninstalled it (as well as uninstalling and reinstalling Unity) but I am still receiving this issue. I did notice that I had an enivronment variable with key ‘MONO_TLS_PROVIDER’ and value ‘legacy’ which I have subsequently removed but that hasn’t helped either. All web request code is running fine on my colleagues machines (who haven’t installed the standalone Mono) so I know that it should be working fine and that my machine has some issue.
I’m out of ideas at present though about what else to try to resolve this issue and was hoping that someone would be able to provide some suggestions as to what might be going wrong here.
Thanks
Project Info:
OS: Windows 10
Unity Version: 2018.4.4f1
Scripting backend: .Net 4.x Equivalent
API Compatability Level: .NET Standard 2.0