Created
December 22, 2022 17:24
-
-
Save giuliofurlan/36a6bd8c16dcb386b85297966c53777f to your computer and use it in GitHub Desktop.
Allow CLEARTEXT communication on android 4.4 and OkHttp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OkHttpClient.Builder b = new OkHttpClient.Builder(); | |
b.connectTimeout(3000L, TimeUnit.MILLISECONDS); | |
b.readTimeout(10000L, TimeUnit.MILLISECONDS); | |
b.connectionSpecs(Arrays.asList(ConnectionSpec.MODERN_TLS, ConnectionSpec.CLEARTEXT)); | |
OkHttpClient client = b.build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment