Certificate_verify_failed

I am trying to login using realm-dotnet version: 10.15.1.
While using MAUI, it logged in fine.
But when I use the same code for login in xamarin i get the following error:

{Realms.Sync.Exceptions.AppException: code 998: An unexpected error occurred while sending the request: Authentication failed, see inner exception.: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
  at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/boringssl/ssl/handshake_client.c:1132
  at Realms.Sync.AppHandle.LogInAsync (Realms.Sync.Native.Credentials credentials) [0x00055] in D:\a\realm-dotnet\realm-dotnet\Realm\Realm\Handles\AppHandle.cs:294 
  at Realms.Sync.App.LogInAsync (Realms.Sync.Credentials credentials) [0x0003d] in D:\a\realm-dotnet\realm-dotnet\Realm\Realm\Sync\App.cs:214

Here is the code I used to login:

if(this._dbService == null)
                {
                    _dbService = Ioc.Default.GetService<IDbService>();
                }

                if (_dbService != null)
                {
                    var user = await _dbService.LoginAsync(email, password);
                    if (user != null)
                    {

                        return ResultType.SUCCESS;

                    }
                    else
                    {
                        return ResultType.UNKNOWN;

                    }
                }
                else
                {
                    return ResultType.UNKNOWN;
                }

What http client are you using? Because our cloud certificates are issued by Let’s Encrypt, those will work well with the native android client, but not with the BoringSSL implementation that Xamarin ships with.

The reason is a bit convoluted, but it boils down to a bug in the Android http client that doesn’t validate expiration of root certificates, which allows Let’s Encrypt to cross-sign certificates with their old root CA and support older Android versions.

My suggestion would be to try and enable the native AndroidClientHandler from your project settings and see if that solves the issue.

Thanks,
I will be back after trying this.

@nirinchev Its working now,
Thank you very much.