2016-12-30 46 views
1

我有一个Xamarin PCL客户端使用带有Letsnecrypt证书的SSL与WebApi后端对话。当使用端口号443(URL中的no:443,只是https)时,一切正常。Xamarin PCL使用其他端口而不是443与REST Api进行通信

由于各种原因,我无法使用此端口,所以我切换到8082。现在我在客户端得到以下错误:

Error: SecureChannelFailure (The authentication or decryption has failed.)

at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) [0x00051] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:883 at Mono.Net.Security.Private.LegacySslStream.EndAuthenticateAsClient (System.IAsyncResult asyncResult) [0x00011] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:475 at Mono.Net.Security.Private.LegacySslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x00000] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:445 at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) [0x0001e] in /Users/builder/data/lanes/3511/77cb8568/source/mono/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs:99

当我在客户端使用浏览器并打开URL时,一切正常。证书已获批准。已尝试https://www.digicert.com/help/检查证书,一切正常。

我使用ModernHttpClient:

client = new HttpClient(new NativeMessageHandler()); 

我在做什么错?

回答

0

我相信这可能是一个单声道错误[1]已被修复,但修复只发布到我们的Alpha通道。你可以尝试更新到Alpha通道[2]并查看问题是否已解决?

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=46549

[2]切换更新通道:

In Xamarin Studio, you can switch the update channel with the Xamarin Studio->Check for Updates… menu, choosing Stable, Beta, or Alpha in the drop down next to Update Channel and then clicking the Switch Channel button.

In Visual Studio, navigate to menu Tools->Options and scroll down to expand the Xamarin section and select "Other". Choose Stable, Beta, or Alpha from the drop down menu and click Check Now. If updates to that channel are available, you will get a dialog similar to the above for Xamarin Studio. Proceed as above.

相关问题