The error I get is:
java.net.SocketTimeoutException: SSL handshake timed out
The broker is a custom (C#) one based on a NuGet package MQTTnet. It uses a Let's Encrypt certificate which all works correctly with a test MQTTnet client.
When I got the error with my Android test client, I downloaded the latest source from GitHub and changed the server authentication code from
await sslStream.AuthenticateAsServerAsync(_tlsCertificate, false, SslProtocols.Tls12, false).ConfigureAwait(false);
to
await sslStream.AuthenticateAsServerAsync(_tlsCertificate, false, SslProtocols.Tls, false).ConfigureAwait(false);
My broker then worked with my Android test client.
I've subsequently changed the broker code back TLS1.2 and done some more testing. I've discovered the error only appears with an old Android 4.4 tablet (which as luck would have it was what I was doing my initial testing with
). On newer devices, TLS v1.2 is negotiated quite successfully (so the existing MQTT client *does* support TLS1.2).
Problem identified (not quite solved).
Thanks for the quick response.