2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 13:47:41 +00:00

Bump the TLS version to 1.2

TLSv1.2 is supported on all the Android versions we support now.
TLSv1.3 is only supported in API 29+. Although we could conditionally
enable it on 29+, it seems to cause problems (disconnects & reconnects
when the LanLink gets refreshed) also on newer devices.
This commit is contained in:
Albert Vaca Cintora
2023-04-24 19:08:24 +02:00
committed by Simon Redman
parent 71706879d0
commit acb869b21c

View File

@@ -209,7 +209,7 @@ public class SslHelper {
trustManagerFactory.init(keyStore); trustManagerFactory.init(keyStore);
// Setup custom trust manager if device not trusted // Setup custom trust manager if device not trusted
SSLContext tlsContext = SSLContext.getInstance("TLSv1"); //Newer TLS versions are only supported on API 16+ SSLContext tlsContext = SSLContext.getInstance("TLSv1.2"); // Use TLS up to 1.2, since 1.3 seems to cause issues in some (older?) devices
if (isDeviceTrusted) { if (isDeviceTrusted) {
tlsContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), RandomHelper.secureRandom); tlsContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), RandomHelper.secureRandom);
} else { } else {