OkHttp 3.13 Requires Android 5+

Jesse Wilson
Feb 5, 2019 · 3 min read
Image for post
Image for post
  • Java 7+ (released July 2011)
  • Java 8+ (released March 2014)

Why Android 5+ and Why Now?

TLS is the mechanism that makes HTTPS calls secure, private, and authenticated. OkHttp is aware of five versions: SSLv3 (1996), TLSv1 (1999), TLSv1.1 (2006), TLSv1.2 (2008), and TLSv1.3 (2018). We dropped support for SSLv3 in 2014 in response to the POODLE attack.

What about Android 4.x?

Google’s distribution dashboard shows that ~11% of the devices that visited the Play Store in October 2018 were running Android 4.x. We’ve created a branch, OkHttp 3.12.x, to support these devices. Should we encounter any severe bugs or security problems we’ll backport the fixes and release. We plan to maintain this branch through December 31, 2020.

How do I upgrade?

Confirm that your project’s minSdkVersion is at least 21 and that your Android Gradle Plugin version is at least 3.2. Then use our new Maven coordinates in your build.gradle:

dependencies {
implementation "com.squareup.okhttp3:okhttp:3.13.1"
...
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
...
}
OkHttpClient client = new OkHttpClient.Builder()
.connectionSpecs(Arrays.asList(ConnectionSpec.COMPATIBLE_TLS))
.build();

Thanks

We developers spend a lot of time and energy keeping dependencies up-to-date. We should celebrate this work! Our users trust their apps with what’s most important to them including private conversations, money, and family photos. We honor that trust by securing their data in the best way we can.

Square Corner Blog

Buying and selling sound like simple things - and they…

Thanks to Benoît Quenaudon, Egor Andreevich, and Jake Wharton

Jesse Wilson

Written by

Android and jokes.

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Jesse Wilson

Written by

Android and jokes.

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store