2016-06-20 16 views
9

Tôi có ứng dụng WPF, sử dụng SSLStream để kết nối với máy chủ và gửi/nhận một số tin nhắn. Mã của tôi lớn hơn dựa trên ví dụ này (SslTcpClient): https://msdn.microsoft.com/en-us/library/system.net.security.sslstream(v=vs.110).aspx.Cuộc gọi tới SSPI không thành công, xem ngoại lệ bên trong - Không thể liên lạc với Cơ quan an ninh địa phương

Điều này hoạt động tốt trong nhiều tháng. Tuy nhiên, sau khi cập nhật cửa sổ này (Cập Nhật tích luỹ cho Windows 10 phiên bản 1511 và Windows Server 2016 Xem trước kỹ thuật 4: ngày 14 tháng 6 năm 2016 - https://support.microsoft.com/en-us/kb/3163018). Ứng dụng của tôi bắt đầu báo cáo ngoại lệ này:

System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The Local Security Authority cannot be contacted 
    --- End of inner exception stack trace --- 
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception) 
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) 
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) 
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) 
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) 
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) 
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) 
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.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation) 
at MyAPP.Core.Services.Network.Impl.SslTcpClient.ClientSideHandshake() 
at MyAPP.Core.Services.Network.Impl.SslTcpClient.Connect() 
at MyAPP.Core.Services.Impl.MessageService.SendMessage(String message) 

Tôi có thể làm gì?

+1

Chúng tôi gặp sự cố tương tự sau lần cập nhật này trên các máy tính Windows 10 của chúng tôi. Chúng tôi đang sử dụng kết nối MySQL .NET kết nối với một DB MySQL từ xa qua SSL. –

Trả lời

8

Dưới đây là giải pháp, thiết lập trong registry:

[HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ SecurityProviders \ SCHANNEL \ KeyExchangeAlgorithms \ Diffie-Hellman] "ClientMinKeyBitLength" = dword: 00000200

như ghi chú here

+0

[Liên kết này] (https://support.microsoft.com/en-us/help/3061518/ms15-055-vulnerability-in-schannel-could-allow-information-disclosure-may-12,-2015) là tham chiếu đến thảo luận kỹ thuật MS về lý do tại sao hỗ trợ DH 512 đã bị xóa. –

4

Điều này có nghĩa là bên kia sử dụng một phiên bản khác của tls và bạn là phiên bản cũ hơn. Thiết lập thuộc tính bảo mật cho Tls12 trước khi tạo kết nối. Đây là vấn đề được biết đến, nhiều nhà cung cấp bắt đầu sử dụng Tls12 paypal, amazon và như vậy.

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 
Các vấn đề liên quan