在https://square.github.io/okhttp/有这么一段话:
Requirements¶
OkHttp works on Android 5.0+ (API level 21+) and on Java 8+.
OkHttp has one library dependency on Okio, a small library for high-performance I/O.
We highly recommend you keep OkHttp up-to-date. As with auto-updating web browsers, staying current with HTTPS clients is an important defense against potential security problems. We track the dynamic TLS ecosystem and adjust OkHttp to improve connectivity and security.
OkHttp uses your platform’s built-in TLS implementation. On Java platforms OkHttp also supports Conscrypt, which integrates BoringSSL with Java. OkHttp will use Conscrypt if it is the first security provider:
Security.insertProviderAt(Conscrypt.newProvider(), 1);
The OkHttp 3.12.x branch supports Android 2.3+ (API level 9+) and Java 7+. These platforms lack support for TLS 1.2 and should not be used. But because upgrading is difficult we will backport critical fixes to the 3.12.x branch through December 31, 2020.
说的很清楚,安卓平台,OKhttp最低支持5.0的系统。
要兼容4.x,就用3.12.x的版本:
implementation("com.squareup.okhttp3:mockwebserver:3.12.0")
3.12.x目前最新3.12.3经测试正常










网友评论