2016-12-30 44 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.

相關問題