Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We use a similar <code>SocketFactory</code> and <code>X509TrustManager</code> implementation in some of our projects. In order to bind these classes up to your implementation, all you basically should have to do is hook them up to the <code>HttpClient</code> (assuming that's what you're using) used for client-server communication. </p> <p>We normally have a method to create an <code>HttpClient</code> with the mentioned factory and trustmanager. It looks somewhat like this and is loosely based on the link shown in the inline comments.</p> <pre><code>protected HttpClient constructClient() { HttpParams params = new BasicHttpParams(); params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); // use the debug proxy to view internet traffic on the host computer if (ABCApplication.isDebuggingProxy()) params.setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(ABCConstants.DEBUG_PROXY_HOST, ABCConstants.DEBUG_PROXY_PORT, "http")); // ignore ssl certification (due to signed authority not appearing on android list of permitted authorities) // see: http://blog.antoine.li/2010/10/22/android-trusting-ssl-certificates/ SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme("http", new PlainSocketFactory(), 80)); registry.register(new Scheme("https", new FakeSocketFactory(), 443)); ClientConnectionManager cm = new SingleClientConnManager(params, registry); return new DefaultHttpClient(cm, params); } </code></pre> <p>Hope that helps with your implementation.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload