From 11dd32c354273b587757622160c9665e00064f3c Mon Sep 17 00:00:00 2001 From: zuhdil Date: Thu, 25 May 2023 16:02:41 +0700 Subject: [PATCH] [#1936] Enable TLS 1.2 --- .../java/org/akvo/flow/injector/module/ApplicationModule.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/akvo/flow/injector/module/ApplicationModule.java b/app/src/main/java/org/akvo/flow/injector/module/ApplicationModule.java index 944e74b4a..522f90660 100644 --- a/app/src/main/java/org/akvo/flow/injector/module/ApplicationModule.java +++ b/app/src/main/java/org/akvo/flow/injector/module/ApplicationModule.java @@ -86,6 +86,7 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Locale; import java.util.TimeZone; import java.util.concurrent.TimeUnit; @@ -95,6 +96,7 @@ import dagger.Module; import dagger.Provides; import io.reactivex.schedulers.Schedulers; +import okhttp3.ConnectionSpec; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; @@ -335,6 +337,7 @@ private OkHttpClient.Builder createHttpClient( httpClient.addInterceptor(loggingInterceptor); httpClient.connectTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); httpClient.readTimeout(NO_TIMEOUT, TimeUnit.SECONDS); + httpClient.connectionSpecs(Arrays.asList(ConnectionSpec.MODERN_TLS, ConnectionSpec.COMPATIBLE_TLS, ConnectionSpec.CLEARTEXT)); return httpClient; } }