Skip to content

Commit

Permalink
Fixed:trusty config broken with android4.4 Issue: github.com/wkh237/i…
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingPapi committed May 18, 2018
1 parent 821eeb0 commit 48f18c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,9 @@ public void onReceive(Context context, Intent intent) {
public static OkHttpClient.Builder enableTls12OnPreLollipop(OkHttpClient.Builder client) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
try {
client.sslSocketFactory(new TLSSocketFactory());
//we should not reset sslSocketFactory here, this will override the sslSocketFactory
// which is set in method RnFetchBlobUtils.getUnsafeOkHttpClient, makes trusty config broken in Android4.4
//client.sslSocketFactory(new TLSSocketFactory());

ConnectionSpec cs = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.tlsVersions(TlsVersion.TLS_1_2)
Expand Down

0 comments on commit 48f18c8

Please sign in to comment.