Created
February 12, 2018 15:18
-
-
Save nontravis/0a81b34a6f182768d2b9d90e88bf4d29 to your computer and use it in GitHub Desktop.
client_nougat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OkHttpClient.Builder builder = new OkHttpClient.Builder(); | |
// for resolve SSLHandshakeException at Android 7.0 only | |
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) { | |
builder.connectionSpecs(Arrays.asList( | |
ConnectionSpec.MODERN_TLS, | |
ConnectionSpec.CLEARTEXT, | |
new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) | |
.allEnabledTlsVersions() | |
.allEnabledCipherSuites() | |
.build()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment