Mono Service Exception - The authentication or decryption has failed
Try to replace this line:
var ssl_stream = new SslStream(csGlobal.m_tcp_client.GetStream(), false, (sender, certificate, chain, ssl_policy_errors) => ssl_policy_errors == SslPolicyErrors.None);
with this:
var ssl_stream = new SslStream(csGlobal.m_tcp_client.GetStream());
WebClient.DownloadString with HTTPS The authentication or decryption has failed
After some rigorous research it turns out that the version of Mono that Unity(2017.2.0f3) currently uses does not support TLS 1.2, as explained by a developer here. Also, a careful examination of the exception log shows that internally, the legacy backend is being used: Mono.Net.Security.Private.LegacySslStream
as opposed to Mono.Net.Security.Private.SslStream
. As of right now, the only solution would involve third-party libraries, or workarounds.
Thanks to @Evk for pointing me in the right direction.
Related Topics
When to Use Cast() and Oftype() in Linq
Why Are C# 3.0 Object Initializer Constructor Parentheses Optional
The Name 'Controlname' Does Not Exist in the Current Context
How to Concatenate Two Arrays in C#
Differencebetween Nullable<T>.Hasvalue or Nullable<T> != Null
Find an Item in a List by Linq
Uwp Enable Local Network Loopback
Show a Form Without Stealing Focus
Do Try/Catch Blocks Hurt Performance When Exceptions Are Not Thrown
How to Write a Backslash (\) in a String
Using JSONconvert.Deserializeobject to Deserialize JSON to a C# Poco Class