Skip to content

Commit

Permalink
add the fix for http2 back
Browse files Browse the repository at this point in the history
  • Loading branch information
tcitworld committed May 22, 2016
1 parent 1ecfbac commit abcbbf2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import okhttp3.Interceptor;
import okhttp3.JavaNetCookieJar;
import okhttp3.OkHttpClient;
import okhttp3.Protocol;
import okhttp3.Request;
import okhttp3.Response;

Expand All @@ -24,6 +25,7 @@
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
Expand Down Expand Up @@ -119,6 +121,12 @@ public static OkHttpClient createClient() {
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
b.cookieJar(new JavaNetCookieJar(cookieManager));

// TODO : Delete this part when OKHTTP 3.3 is released https://github.com/square/okhttp/issues/2543
List<Protocol> protocolList = new ArrayList<>();
protocolList.add(Protocol.SPDY_3);
protocolList.add(Protocol.HTTP_1_1);
b.protocols(protocolList);

Settings settings = App.getInstance().getSettings();

if(settings.getBoolean(Settings.CUSTOM_SSL_SETTINGS, false)) {
Expand Down

0 comments on commit abcbbf2

Please sign in to comment.