单声道 TLS 错误 TLSV1_ALERT_PROTOCOL_VERSION

Mono TLS error TLSV1_ALERT_PROTOCOL_VERSION

我有一个执行 HTTP 请求的 ASP.NET 应用程序,它本周开始抛出此错误。

2019-11-15 16:05:35,833 Error Line:0 121156 Thread: Thread Pool Worker Level: ERROR Logger: Joystick.WebServices.Infrastructure.Log4NetLogger Message: System.Net.WebException: Error: SecureChannelFailure (Authentication failed, see inner exception.) ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000042e:SSL routines:OPENSSL_internal:TLSV1_ALERT_PROTOCOL_VERSION
  at /build/mono-6.4.0.198/external/boringssl/ssl/tls_record.c:462
  at Mono.Btls.MonoBtlsContext.ProcessHandshake () [0x00048] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncOperationStatus status, System.Boolean renegotiate) [0x000da] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at (wrapper remoting-invoke-with-check) Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake(Mono.Net.Security.AsyncOperationStatus,bool)
  at Mono.Net.Security.AsyncHandshakeRequest.Run (Mono.Net.Security.AsyncOperationStatus status) [0x00006] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (System.Threading.CancellationToken cancellationToken) [0x000fc] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
   --- End of inner exception stack trace ---
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Boolean runSynchronously, Mono.Net.Security.MonoSslAuthenticationOptions options, System.Threading.CancellationToken cancellationToken) [0x00262] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at Mono.Net.Security.MonoTlsStream.CreateStream (System.Net.WebConnectionTunnel tunnel, System.Threading.CancellationToken cancellationToken) [0x00176] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at System.Net.WebConnection.CreateStream (System.Net.WebOperation operation, System.Boolean reused, System.Threading.CancellationToken cancellationToken) [0x001ba] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
   --- End of inner exception stack trace ---
  at System.Net.WebConnection.CreateStream (System.Net.WebOperation operation, System.Boolean reused, System.Threading.CancellationToken cancellationToken) [0x0021a] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at System.Net.WebConnection.InitConnection (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x00141] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at System.Net.WebOperation.Run () [0x0009a] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at System.Net.WebCompletionSource`1[T].WaitForCompletion () [0x00094] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at System.Net.HttpWebRequest.GetRequestStream () [0x00016] in <2703bbaa0a6e4686b6033c2dddb1a363>:0 
  at Joystick.WebServices.Handlers.Nap.NapWebHandler.SendRequest (Joystick.Dto.System.NapCheckDto patient) [0x00121] in <7c3b0be4b3414e1c95351062f5cf9947>:0 
  at Joystick.WebServices.Handlers.Nap.NapWebHandler.ProcessMessage (Joystick.Dto.System.NapCheckDto req) [0x00027] in <7c3b0be4b3414e1c95351062f5cf9947>:0 


单声道版本:6.4.0.198。

我尝试了什么:


Environment.SetEnvironmentVariable("MONO_TLS_PROVIDER", "legacy", EnvironmentVariableTarget.User);
AppContext.SetSwitch("Switch.System.Security.Cryptography.Xml.UseInsecureHashAlgorithms", true);
AppContext.SetSwitch("Switch.System.Security.Cryptography.Pkcs.UseInsecureHashAlgorithms", true);
AppContext.SetSwitch("Switch.System.Net.DontEnableSystemDefaultTlsVersions", true);


没有任何帮助。

这是网站,他们正在更换主机,并且有一段时间使用旧的基础设施导致了这个问题。