Skip to content

Instantly share code, notes, and snippets.

@Kane-Shih
Kane-Shih / 00_READ_ME.txt
Last active December 6, 2023 18:17
Enable TLS 1.2 in Android 4.4
1. To enable TLS 1.2 in Android 4.4
Copy TLSSocketFactory.java
If using HttpsURLConnection:
=> conn.setSSLSocketFactory(new TLSSocketFactory());
Else if using OkHttp:
=> new OkHttpClient.Builder().setSocketFactory(new TLSSocketFactory()). ... .build();
Else if using HttpClient:
sample for legacy apache http library: https://github.com/Kane-Shih/TestApacheHttpClient
=> see: https://stackoverflow.com/questions/2603691/android-httpclient-and-https