【问题标题】:Mono TLS error TLSV1_ALERT_PROTOCOL_VERSION单声道 TLS 错误 TLSV1_ALERT_PROTOCOL_VERSION
【发布时间】:2020-03-11 20:32:42
【问题描述】:

我有一个执行 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);


没有任何帮助。

【问题讨论】:

  • 使用 TLS 1.2,无论你连接什么都不再支持过时的 TLS 1.0
  • 怎么样?这就是我不知道如何让 ti 使用更高版本的 TLS 的关键。
  • 您正在设置环境。要使用旧版,请不要这样做。 stackoverflow.com/a/41842279/4984832

标签: asp.net ssl mono


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-31
    • 1970-01-01
    • 2013-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-01
    相关资源
    最近更新 更多