Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit a28745b

Browse files
author
Chris Board
committed
Added support for TLSv1.1, 1.2 and 1.3
1 parent 323f7f0 commit a28745b

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed
0 Bytes
Binary file not shown.

.idea/caches/gradle_models.ser

0 Bytes
Binary file not shown.

AndroidMySQLConnector/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ else
2020
}
2121

2222
archivesBaseName="AndroidMySQLConnector"
23-
version '0.28'
23+
version '0.30'
2424
group 'com.BoardiesITSolutions'
2525

2626

@@ -30,8 +30,8 @@ android {
3030
//applicationId "com.BoardiesITSolutions.AndroidMySQLConnector"
3131
minSdkVersion 19
3232
targetSdkVersion 29
33-
versionCode 20
34-
versionName "0.28"
33+
versionCode 21
34+
versionName "0.30"
3535
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3636
}
3737
buildTypes {

AndroidMySQLConnector/src/main/java/com/BoardiesITSolutions/AndroidMySQLConnector/Connection.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,16 @@ private void performSSLHandshake()
519519

520520
SSLSocket sslSocket = (SSLSocket) sslf.createSocket(mysqlSocket, null,
521521
mysqlSocket.getPort(), false);
522-
sslSocket.setEnabledProtocols(new String[]{"TLSv1.1"});
522+
523+
// TLSv1.3 not supported until Android API 29 (Android 10)
524+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
525+
{
526+
sslSocket.setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2"});
527+
}
528+
else
529+
{
530+
sslSocket.setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2", "TLSv1.3"});
531+
}
523532
sslSocket.setTcpNoDelay(true);
524533
sslSocket.setReuseAddress(true);
525534
sslSocket.setSoTimeout(5000);

0 commit comments

Comments
 (0)