我有问题。因为几天我的应用程序正在生成
System.Exception:证书已被撤销。 (HRESULT异常:0x80092010)
奇怪的是,这只发生在Windows Phone 8.1上。在Windows 10移动设备上,相同的代码可以正常工作。
使用
检查证书时Information.ServerCertificate
我得到的信息:
ValidFrom = {28.04.2016 12:16:06 +02:00}
ValidTo = {18.03.2019 07:28:26 +01:00}
这就是我开始套接字连接的方式:
HostName host = address.RemoteHostName;
string port = address.RemoteServiceName;
CancellationTokenSource cts = new CancellationTokenSource();
cts.CancelAfter(6 * 1000);
socket.ConnectAsync(host, port, SocketProtectionLevel.Tls12).AsTask(cts.Token).GetAwaiter().GetResult();
我应该在我的应用程序中执行某些操作(我可以更彻底地调试或检查它)还是严格与服务器认证相关联?
编辑: 4小时后,WM10也开始显示已撤销的错误,而Android和iOS连接没有问题(过去1年的窗户也没有问题)。有没有办法检查证书是否真的被撤销了?
编辑2: 我补充说:
socket.Control.IgnorableServerCertificateErrors.Add(Windows.Security.Cryptography.Certificates.ChainValidationResult.RevocationInformationMissing);
socket.Control.IgnorableServerCertificateErrors.Add(Windows.Security.Cryptography.Certificates.ChainValidationResult.RevocationFailure);
因此事实证明,Windows在获取撤销列表方面有进展。我现在将使用这个工作日,但是非常感谢你解决这个问题的任何帮助。