Xamarin Android SSL Error connecting to SignalR

SSB 81 Reputation points
2021-09-30T18:46:26.54+00:00

Hi I am all of a sudden getting an SSL error when connecting to SignalR from my Xamarin Android app. it is only on Android, not on iPhone.

I am running dot net core WebApi and can connect to that from the Android app (https://) , but SignalR is throwing an error when running the StartAsync() method on the hub connection

Any ideas how to resolve or how to investigate this further please?

Message "The SSL connection could not be established, see inner exception."

InnerException {System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED at /Users/builder/jenkins/workspace/archive-mono/…}

StackTrace " at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore (System.IO.Stream stream, System.Net.Security.SslClientAuthenticationOptions sslOptions, System.Threading.CancellationToken cancellationToken) [0x000f6] in /Users/builder/jenkins/workspace/arch…"

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,273 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,222 questions
{count} vote

4 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 53,501 Reputation points
    2021-09-30T20:15:19.82+00:00

    android is complaining that the SSL certificate is not trusted. that is its not signed by trusted source. if this is a self signed certificate, you must install it on the phone. google for instructions for your version of Android.

    if you paid for the cert, the seller is not trusted.

    0 comments No comments

  2. Derek Massey 1 Reputation point
    2021-09-30T22:22:48.677+00:00

    Probably releated to DST Root CA X3 expiration of LetsEncrypt certificates Sept 20, 2021

    https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

    the following issue has been posted on xamarin-android on github.

    https://github.com/xamarin/xamarin-android/issues/6351

    We have no solution yet, The suggested workaround of renewing LetsEncrypt Acme did not work for us

    0 comments No comments

  3. Uzair Ali 16 Reputation points
    2021-10-01T07:44:18.037+00:00

  4. Stefanov 1 Reputation point
    2021-10-06T19:00:30.4+00:00

    I posted my workaround for kubernetes with Cert-Manager environment: https://github.com/xamarin/xamarin-android/issues/6351#issuecomment-936909856
    Basically I added the preferredChain: "ISRG Root X1" line to the ClusterIssuer yaml recipe.

    0 comments No comments