Package org.apache.commons.httpclient.protocol

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


    if (PROTOCOL_HTTPS.equalsIgnoreCase(schema)){
      SSLManager.getInstance(); // ensure the manager is initialised
      // we don't currently need to do anything further, as this sets the default https protocol
    }
   
    Protocol protocol = Protocol.getProtocol(schema);

    String host = uri.getHost();
    int port = uri.getPort();

        /*
 
View Full Code Here


      
        File clientKeystore = new File("certs/clientKeystore.jks");
        File truststore = new File("certs/commonTruststore.jks");

        // Send HTTP GET request to query customer info - using portable HttpClient method
        Protocol authhttps = new Protocol("https",
                new AuthSSLProtocolSocketFactory(clientKeystore.toURI().toURL(), "password",
                truststore.toURI().toURL(), "password"),
                9000);
        Protocol.registerProtocol("https", authhttps);
View Full Code Here

        if (isHTTPS){
            SSLManager.getInstance(); // ensure the manager is initialised
            // we don't currently need to do anything further, as this sets the default https protocol
        }

        Protocol protocol = Protocol.getProtocol(schema);

        String host = uri.getHost();
        int port = uri.getPort();

        /*
 
View Full Code Here

            });

            /*
             * Also set up HttpClient defaults
             */
            Protocol protocol = new Protocol(
                    JsseSSLManager.HTTPS,
                    (ProtocolSocketFactory) new HttpSSLProtocolSocketFactory(this, CPS),
                    443);
            Protocol.registerProtocol(JsseSSLManager.HTTPS, protocol);
            log.debug("SSL stuff all set");
View Full Code Here

  }
 
  private void configureClient() {

    // Set up an HTTPS socket factory that accepts self-signed certs.
    Protocol dummyhttps = new Protocol("https", new DummySSLProtocolSocketFactory(), 443);
    Protocol.registerProtocol("https", dummyhttps);
   
    HttpConnectionManagerParams params = connectionManager.getParams();
    params.setConnectionTimeout(timeout);
    params.setSoTimeout(timeout);
View Full Code Here

  public static void registerFactory(
    SecureProtocolSocketFactory factory,
    int port) {
      Protocol.registerProtocol(
        "https",
        new Protocol(
          "https",
          (ProtocolSocketFactory)factory, port));
  }
View Full Code Here

    @Override
    public synchronized void setHost(URI uri)
    {
        try
        {
            Protocol original = getProtocol();
   
            if (uri.getScheme().equals(original.getScheme()))
            {
                Protocol newProtocol = new Protocol(uri.getScheme(), original.getSocketFactory(),
                    original.getDefaultPort());
   
                    super.setHost(uri.getHost(), uri.getPort(), newProtocol);
            }
            else
            {
                Protocol protoByName = Protocol.getProtocol(uri.getScheme());
                super.setHost(uri.getHost(), uri.getPort(), protoByName);
            }
        }
        catch (URIException uriException)
        {
View Full Code Here

    }

    @Override
    public synchronized void setHost(HttpHost host)
    {
        Protocol newProtocol = cloneProtocolKeepingSocketFactory(host.getProtocol());
       
        HttpHost hostCopy = new HttpHost(host.getHostName(), host.getPort(), newProtocol);
        super.setHost(hostCopy);
    }
View Full Code Here

    }

    @Override
    public synchronized void setHost(String host, int port, String protocolName)
    {
        Protocol protoByName = Protocol.getProtocol(protocolName);
        Protocol newProtocol = cloneProtocolKeepingSocketFactory(protoByName);       

        super.setHost(host, port, newProtocol);
    }
View Full Code Here

    @Override
    @SuppressWarnings("deprecation")
    public synchronized void setHost(String host, String virtualHost, int port, Protocol protocol)
    {
        Protocol newProtocol = cloneProtocolKeepingSocketFactory(protocol);       
        super.setHost(host, virtualHost, port, newProtocol);
    }
View Full Code Here

TOP

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

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.