Reputation: 164
I have an Android app that strictly runs on a version of Android that cannot use Google Play Services. The app makes data requests via HttpsUrlConnection from a remote server that is being update to only support TLS 1.2 handshaking. I looked at this blog post and tried to implement it but it does not work for me. I know I could get it to work using Google Play Services and updating the SSL Provider, but that is not an option with my specific Android devices. My question is, can I get TLS 1.2 to work on Android 4.4 without the help of Google Play Services?
Upvotes: 4
Views: 4896
Reputation: 164
I ended up installing a copy of Google Play Services from apkmirror.com to solve this issue and use:
ProviderInstaller.installIfNeeded(getContext());
Upvotes: -3
Reputation: 1142
I had same requirement. i was able enable TLS 1.1+ for Android 4.1 using httpClient 4.1.2 I used this link https://github.com/erickok/transdroid/blob/master/app/src/main/java/org/transdroid/daemon/util/TlsSniSocketFactory.java
Once you include that file in your code, just refer them as in below code.
SchemeRegistry registry = new SchemeRegistry();
registry.register(new Scheme("https", new TlsSniSocketFactory(), 443));
client = new DefaultHttpClient(new ThreadSafeClientConnManager(httpParameters, registry),httpParameters);
Hope this helped you.
Upvotes: 2