I am developing a Flutter Android application, and the app is showing a HandshakeException on devices running Android 11, Android 12, and Android 13.
The issue started after the SSL certificate was updated on the server. Before the SSL certificate update, the application was working correctly on these Android versions.
The error shown in the Flutter logs is:
FormatException: Unexpected character (at character 1)
Unexpected Error:
HandshakeException: Handshake error in client (OS Error:
^
The same error is also displayed in the application as:
enter image description hereenter image description here
FormatException: Unexpected character (at character 1)
Unexpected Error:
HandshakeException: Handshake error in client (OS Error:
^
The issue appears to be related to the SSL/TLS handshake or certificate compatibility with Android 11, 12, and 13.
Expected behavior:
The application should establish the HTTPS connection successfully and fetch the required API data/files.
Actual behavior:
The HTTPS request fails with HandshakeException: Handshake error in client.
Could anyone help identify the cause of this SSL handshake issue and suggest the correct solution for Flutter/Android 11, 12, and 13?
Any guidance regarding SSL certificate configuration, TLS version, certificate chain, Android Network Security Configuration, or Flutter HTTP client configuration would be appreciated.