1

我在使用 Bouncy Castle 向 Window Phone 7 上的服务器发送客户端证书时遇到问题。

我创建了自己的从接口继承的 TlsAuthentication 和 TlsCredential 类。但在方法

public TlsCredentials GetClientCredentials(CertificateRequest certificateRequest)
    {
        return this.TlsCredentials;
    }

发生异常。

以下是我的例外:

An exception of type 'Org.BouncyCastle.Crypto.Tls.TlsFatalAlert' occurred in bouncywp71.DLL and wasn't handled before a managed/native boundary

A first chance exception of type 'System.IO.IOException' occurred in bouncywp71.DLL

An exception of type 'System.IO.IOException' occurred in bouncywp71.DLL and wasn't handled before a managed/native boundary

Internal TLS error, this could be an attack
at Org.BouncyCastle.Crypto.Tls.TlsProtocolHandler.FailWithError(AlertLevel alertLevel, AlertDescription alertDescription)
at Org.BouncyCastle.Crypto.Tls.TlsProtocolHandler.SafeReadData()
at Org.BouncyCastle.Crypto.Tls.TlsProtocolHandler.Connect(TlsClient tlsClient)
at MYAPP.MyTest2.Network.Security.MyTestSecureClient.HandleConnectionReady()
at SocketEx.TcpClient.InnerConnect(EndPoint myEndpoint)
at MYAPP.MyTest2.Network.Security.MyTestSecureClient..ctor(String host, Int32 port, TlsClient tlsClient)
at MYAPP.MyTest2.Network.Security.MyTestSecureClient..ctor(String host, Int32 port)
at MYAPP.MyTest2.Network.ConnectionManager.CreateConnection(String host, Int32 port)
at MYAPP.MyTest2.Network.ConnectionManager..ctor(String host, Int32 port)
at MYAPP.MyTest2.Network.MyTestService.CreateConnectionManager(String host, Int32 port)
at MYAPP.MyTest2.Network.MyTestService.Login(LoginRequestModel request)
at MYAPP.MyTest2.ViewModel.LoginViewModel.<Login>b__1()
at MYAPP.MyTest2.Common.Helpers.ThreadHandler.<>c__DisplayClass3`1.<Execute>b__0(Object x)

如果有人知道如何解决这个问题,请帮助我!

问候, 阿图尔

4

0 回答 0