2

Any idea what is the workaround on my App. My app works perfectly before when our server using TLS 1.2,After we upgraded to TLS 1.3, all HttpClient POST and GET Request are not working and get the exception

INNER EXCEPTION

Javax.Net.Ssl.SSLProtocolException: SSL handshake aborted: ssl=0xcb444f08: Failure in SSL library, usually a protocol error
error:1000042e:SSL routines:OPENSSL_internal:TLSV1_ALERT_PROTOCOL_VERSION (external/boringssl/src/ssl/tls_record.cc:592 0xcb172b48:0x00000001)
  --- End of managed Javax.Net.Ssl.SSLProtocolException stack trace ---
javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xcb444f08: Failure in SSL library, usually a protocol error
error:1000042e:SSL routines:OPENSSL_internal:TLSV1_ALERT_PROTOCOL_VERSION (external/boringssl/src/ssl/tls_record.cc:592 0xcb172b48:0x00000001)
    at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
    at com.android.org.conscrypt.NativeSsl.doHandshake(NativeSsl.java:375)
    at com.android.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(ConscryptFileDescriptorSocket.java:224)
    at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:192)
    at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:149)
    at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
    at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
    at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
    at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
    at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
    at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
    at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:89)
    at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:26)

Below image is the advance Android Option configuration I used. enter image description here

Below snippets is ny HttpClient setup for HttpClient request.

public HttpClient httpClient { get; set; }

public ApiServiceBase()
{
    this.httpClient = new HttpClient() { BaseAddress = BaseAddress };
    this.httpClient.Timeout = TimeSpan.FromSeconds(60);
    this.httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
}

enter image description here

  • Visual Studio Community 2019 Version 16.7.2
  • .Net Framework Version 4.8
Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123
parpar
  • 103
  • 1
  • 17
  • 1
    Add the exception you got and the inner exception also. – o_w Aug 23 '20 at 13:47
  • Yes, please provide the inner exception as well as @o_w mentioned. You can also try these https://stackoverflow.com/questions/59887091/how-to-make-calls-to-http2-on-xamarin-forms/62394603#62394603 – Saamer Aug 23 '20 at 22:17
  • "the ssl connection could not be established see inner exception. authentication failed" That's the inner exception, It's occurred when we upgrade our server TLS from 1.2 to 1.3, It's only happen in Android platform in my Xamarin Forms. I do a lot of research including James Montemagno suggestions but it won't work. – parpar Aug 24 '20 at 03:06
  • Javax.Net.Ssl.SSLProtocolException: SSL handshake aborted: ssl=0xcb444f08: Failure in SSL library, usually a protocol error error:1000042e:SSL routines:OPENSSL_internal:TLSV1_ALERT_PROTOCOL_VERSION (external/boringssl/src/ssl/tls_record.cc:592 0xcb172b48:0x00000001) --- End of managed Javax.Net.Ssl.SSLProtocolException stack trace --- javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xcb444f08: Failure in SSL library, usually a protocol error error:1000042e:SSL routines:OPENSSL_internal:TLSV1_ALERT_PROTOCOL_VERSION – parpar Aug 26 '20 at 00:42
  • I already post the detailed InnerException in my question above. Kindly check, please. Thanks – parpar Aug 26 '20 at 00:45
  • What type of project is `Mobile.Client.APIService`? E.g. Is it .NET Standard 2.0? – Brandon Minnick Aug 28 '20 at 16:18
  • Hi Brandon, Yes It is .Net Standard 2.0. All Libraries I used are .Net standard 2.0 – parpar Aug 30 '20 at 02:07
  • Hi @parpar! Have you found a solutions for this? – Mario Duarte Jan 10 '21 at 13:25

0 Answers0