diff --git a/build.gradle b/build.gradle index c0aca7e..d88adf6 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,7 @@ ext{ compileSdk : 28, gradlePlugin : '2.1.0', buildTools : '28.0.3', - minSdk : 15, + minSdk : 16, targetSdk: 28 ] ] diff --git a/trustkit/src/main/java/com/datatheorem/android/trustkit/TrustKit.java b/trustkit/src/main/java/com/datatheorem/android/trustkit/TrustKit.java index a2aef8e..ea9ed89 100644 --- a/trustkit/src/main/java/com/datatheorem/android/trustkit/TrustKit.java +++ b/trustkit/src/main/java/com/datatheorem/android/trustkit/TrustKit.java @@ -360,7 +360,7 @@ public static TrustKit getInstance() { @NonNull public SSLSocketFactory getSSLSocketFactory(@NonNull String serverHostname) { try { - SSLContext sslContext = SSLContext.getInstance("TLS"); + SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, new TrustManager[]{getTrustManager(serverHostname)}, null); return sslContext.getSocketFactory(); diff --git a/trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp2Helper.java b/trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp2Helper.java index f8dcb36..c47fb40 100644 --- a/trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp2Helper.java +++ b/trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp2Helper.java @@ -39,7 +39,7 @@ public class OkHttp2Helper { @NonNull public static SSLSocketFactory getSSLSocketFactory() { try { - SSLContext sslContext = SSLContext.getInstance("TLS"); + SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, new X509TrustManager[]{trustManager}, null); return sslContext.getSocketFactory(); diff --git a/trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp3Helper.java b/trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp3Helper.java index 8f176ba..5219e0c 100644 --- a/trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp3Helper.java +++ b/trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp3Helper.java @@ -39,7 +39,7 @@ public class OkHttp3Helper { @NonNull public static SSLSocketFactory getSSLSocketFactory() { try { - SSLContext sslContext = SSLContext.getInstance("TLS"); + SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, new X509TrustManager[]{trustManager}, null); return sslContext.getSocketFactory(); diff --git a/trustkit/src/main/java/com/datatheorem/android/trustkit/reporting/BackgroundReporterTask.java b/trustkit/src/main/java/com/datatheorem/android/trustkit/reporting/BackgroundReporterTask.java index d4771e7..b9aea87 100644 --- a/trustkit/src/main/java/com/datatheorem/android/trustkit/reporting/BackgroundReporterTask.java +++ b/trustkit/src/main/java/com/datatheorem/android/trustkit/reporting/BackgroundReporterTask.java @@ -84,7 +84,7 @@ protected final Integer doInBackground(Object... params) { private static SSLSocketFactory getSystemSSLSocketFactory() { SSLContext context; try { - context = SSLContext.getInstance("TLS"); + context = SSLContext.getInstance("TLSv1.2"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("Should never happen"); }