Package org.apache.commons.httpclient.protocol

Examples of org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory


        HttpClientParams params = client.getParams();
        params.setAuthenticationPreemptive(true);
        client.setParams(params);
        Credentials credentials = new UsernamePasswordCredentials(username, secret);
        client.getState().setCredentials(AuthScope.ANY, credentials);
        client.getHostConfiguration().setHost(host, 443, new Protocol("https", new SSLProtocolSocketFactory() {
            @Override
            public Socket createSocket(Socket socket, String s, int i, boolean b) throws IOException {
                return Utils.createSSLContext().getSocketFactory().createSocket(socket, s, i, b);
            }
View Full Code Here


   * Configures the HTTP client
   */
  private void configureClient() {

    // Set up an HTTPS socket factory that accepts self-signed certs.
    ProtocolSocketFactory factory = new SSLProtocolSocketFactory();
    Protocol https = new Protocol("https", factory, 443);
    Protocol.registerProtocol("https", https);

    HttpConnectionManagerParams params = connectionManager.getParams();
    params.setConnectionTimeout(timeout);
View Full Code Here

      final String inAliasMapString, final FeedType inFeedType,
      boolean useSPSearchVisibility) throws SharepointException {
    // Avoid a deprecation warning on an overloaded Protocol constructor
    // by passing the argument as a ProtocolSocketFactory instead of an
    // SSLProtocolSocketFactory.
    ProtocolSocketFactory socketFactory = new SSLProtocolSocketFactory();
    Protocol.registerProtocol("https",
        new Protocol("https", socketFactory, SPConstants.SSL_DEFAULT_PORT));

    this.clientFactory = clientFactory;
    kdcServer = inKdcHost;
View Full Code Here

        ProtocolSocketFactory p2 = new DefaultProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));

        p1 = new SSLProtocolSocketFactory();
        p2 = new SSLProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
       
    }
View Full Code Here

   * Configures the HTTP client
   */
  private void configureClient() {

    // Set up an HTTPS socket factory that accepts self-signed certs.
    ProtocolSocketFactory factory = new SSLProtocolSocketFactory();
    Protocol https = new Protocol("https", factory, 443);
    Protocol.registerProtocol("https", https);

    HttpConnectionManagerParams params = connectionManager.getParams();
    params.setConnectionTimeout(timeout);
View Full Code Here

        ProtocolSocketFactory p2 = new DefaultProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));

        p1 = new SSLProtocolSocketFactory();
        p2 = new SSLProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
       
    }
View Full Code Here

        ProtocolSocketFactory p2 = new DefaultProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));

        p1 = new SSLProtocolSocketFactory();
        p2 = new SSLProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
       
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.