Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# HttpWebRequest没有';t工作:接收时发生意外错误_C#_.net_Httpwebrequest_Getresponse - Fatal编程技术网

C# HttpWebRequest没有';t工作:接收时发生意外错误

C# HttpWebRequest没有';t工作:接收时发生意外错误,c#,.net,httpwebrequest,getresponse,C#,.net,Httpwebrequest,Getresponse,TLS是TLS 1.3,Linux服务器。 密码:TLS_AES_256_GCM_SHA384 错误:接收时发生意外错误 ''' ''' 但是邮递员做的 请帮帮我 完整的错误详细信息如下: '''See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ***********

TLS是TLS 1.3,Linux服务器。
密码:TLS_AES_256_GCM_SHA384
错误:接收时发生意外错误 '''

''' 但是邮递员做的

请帮帮我

完整的错误详细信息如下:

'''See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm
   at System.Net.SSPIWrapper.AcquireCredentialsHandle(SSPIInterface SecModule, String package, CredentialUse intent, SecureCredential scc)
   at System.Net.Security.SecureChannel.AcquireCredentialsHandle(CredentialUse credUsage, SecureCredential& secureCredential)
   at System.Net.Security.SecureChannel.AcquireClientCredentials(Byte[]& thumbPrint)
   at System.Net.Security.SecureChannel.GenerateToken(Byte[] input, Int32 offset, Int32 count, Byte[]& output)
   at System.Net.Security.SecureChannel.NextMessage(Byte[] incoming, Int32 offset, Int32 count)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.TlsStream.CallProcessAuthentication(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.ConnectStream.WriteHeaders(Boolean async)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at WindowsFormsApplication1.Form1.ND_Get_Token(String username, String password, LabelControl lbMessage, Boolean is_show_msg) in C:\Users\orgil\OneDrive\Documents\Visual Studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 512
   at WindowsFormsApplication1.Form1.btGetEMDToken_Click(Object sender, EventArgs e) in C:\Users\orgil\OneDrive\Documents\Visual Studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 488

''

发布实际的完整错误,而不仅仅是消息中的一些单词。当调试.NET 4.0不受支持,甚至不支持TLS1.2时,您可以使用
Exception.ToString()
或单击异常弹出窗口中的
Copy Details
链接获取完整错误。你不能让它与一个它一无所知的加密算法一起工作。最早支持的.NET旧版本是4.5.2。您应该在几年前升级到受支持的版本-主要服务在近5年前放弃了对TLS1.2以下版本的支持,而4.5.2是最早的受支持版本,您不应该尝试使用低于4.7.2-4.6的版本。有些东西是自动支持TLS1.2的第一个版本,但4.7.2之前的版本与.NET标准2.0包有问题。至于需要TLS1.3的服务器,您确定吗?该标准今年才最终确定,因此服务器无法实际要求客户端仅使用TLS1.3,除非它使用预发布版本。在任何情况下,这种支持都是,这意味着您必须确保操作系统支持TLS1.3。不过,服务器很可能也支持TLS1.2。同样,你需要一个最新版本的.NET和OSYou。另一个帖子说邮差工作了。当网络版本更改时,默认值也会更改,这可能会破坏旧代码。因此,使用像wireshark或fiddler这样的嗅探器,将在职邮递员与非在职邮递员进行比较。检查第一个请求中的TLS版本和标题。
'''See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm
   at System.Net.SSPIWrapper.AcquireCredentialsHandle(SSPIInterface SecModule, String package, CredentialUse intent, SecureCredential scc)
   at System.Net.Security.SecureChannel.AcquireCredentialsHandle(CredentialUse credUsage, SecureCredential& secureCredential)
   at System.Net.Security.SecureChannel.AcquireClientCredentials(Byte[]& thumbPrint)
   at System.Net.Security.SecureChannel.GenerateToken(Byte[] input, Int32 offset, Int32 count, Byte[]& output)
   at System.Net.Security.SecureChannel.NextMessage(Byte[] incoming, Int32 offset, Int32 count)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.TlsStream.CallProcessAuthentication(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.ConnectStream.WriteHeaders(Boolean async)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at WindowsFormsApplication1.Form1.ND_Get_Token(String username, String password, LabelControl lbMessage, Boolean is_show_msg) in C:\Users\orgil\OneDrive\Documents\Visual Studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 512
   at WindowsFormsApplication1.Form1.btGetEMDToken_Click(Object sender, EventArgs e) in C:\Users\orgil\OneDrive\Documents\Visual Studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 488