SweetzpotAS / StravaZpot-Android

A fluent API to integrate with Strava on Android apps
70 stars 35 forks source link

Enable TLS 1.2 on pre-lollipop devices #32

Closed daniel-dumortier closed 5 years ago

daniel-dumortier commented 5 years ago

I encountered a problem using your library on Android 4.4 devices, since Strava only accepts TLS1.2, which is not activated by default on Android 4.

I did not want to use GooglePlay Services to update it (my app is also distributed in china, where GPS is not available), I then add to modify the OkHttp client configuration you use with Retrofit.

I did this using this StackOverflow answer : https://stackoverflow.com/questions/45202267/android-4-1-to-4-4-kitkat-enable-tls-1-2-for-api

I slightly modified it to avoid usage of deprecated sslFactory setter on client, as described in OkHttp javadoc.

daniel-dumortier commented 5 years ago

made an error during my tests, my modifications does not seems to fix the problem. I close the pull request