Resolving SSL Authentication Error on Android for .NET 8 Maui Application Using ca-cert.pem

Sarfaraz Sable 30 Reputation points
2023-12-26T07:29:25.16+00:00

When running my .NET 8 Maui application on Android, I utilized the ca-cert.pem certification for the database. While it functions correctly on Windows, attempting to use it on Android results in the following error: "MySqlConnector.MySqlException (0x80004005): SSL Authentication Error." This error points to an issue with SSL authentication, leading to a System.Security.Authentication.AuthenticationException, specifically an Interop+AndroidCrypto+SslException.

To address this issue, I am seeking a workaround or solution that allows for successful SSL authentication on Android while using the ca-cert.pem certification for the database in my application.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,832 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 69,426 Reputation points
    2023-12-26T20:46:26.8966667+00:00

    Unlike windows, an android application can not override certificate validation. To use a self signed certificate it must be installed. See this thread

    https://stackoverflow.com/questions/71530525/trust-my-own-self-signed-certificate-in-local-network-using-android-native-andr


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.