package info.feelyou.volleyplus;

import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactory;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

import javax.net.ssl.SSLContext;

/**
 * An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
 * uses OkHttp as its transport.
 */
class OkHttpStack extends HurlStack {
    private final OkUrlFactory mFactory;

    public OkHttpStack() {
        this(new OkHttpClient());
    }

    public OkHttpStack(OkHttpClient client) {
        if (client == null) {
            throw new NullPointerException("Client must not be null.");
        }

        try {
            SSLContext sslContext = SSLContext.getInstance("TLS");
            sslContext.init(null, null, null);
            client.setSslSocketFactory(sslContext.getSocketFactory());
        } catch (Exception e) {
            throw new AssertionError(); // The system has no TLS. Just give up.
        }

        mFactory = new OkUrlFactory(client);
    }

    @Override
    protected HttpURLConnection createConnection(URL url) throws IOException {
        return mFactory.open(url);
    }
}
@@ -243,40 +243,205 @@
 RL;%0A
-%0Aimport javax.net.ssl.SSLContext
+import java.security.cert.CertificateException;%0Aimport java.security.cert.X509Certificate;%0A%0Aimport javax.net.ssl.SSLContext;%0Aimport javax.net.ssl.TrustManager;%0Aimport javax.net.ssl.X509TrustManager
 ;%0A%0A/
@@ -883,16 +883,487 @@
   try %7B%0A
+            TrustManager trustManager = new X509TrustManager() %7B%0A                public void checkClientTrusted(X509Certificate%5B%5D chain, String authType) throws CertificateException %7B%0A                %7D%0A%0A                public void checkServerTrusted(X509Certificate%5B%5D chain, String authType) throws CertificateException %7B%0A                %7D%0A%0A                public X509Certificate%5B%5D getAcceptedIssuers() %7B%0A                    return null;%0A                %7D%0A            %7D;%0A
         
@@ -1456,19 +1456,47 @@
 (null, n
-ull
+ew TrustManager%5B%5D%7BtrustManager%7D
 , null);

support https