Package org.apache.http.conn.ssl

Examples of org.apache.http.conn.ssl.AllowAllHostnameVerifier


    private int port2;

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = super.createRegistry();
        registry.bind("x509HostnameVerifier", new AllowAllHostnameVerifier());
        registry.bind("sslContextParameters", new SSLContextParameters());
        registry.bind("sslContextParameters2", new SSLContextParameters());

        registry.bind("http4s-foo", new HttpComponent());
        registry.bind("http4s-bar", new HttpComponent());
View Full Code Here


      params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 60000);
      params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 60000);
      if (skipValidation)
      {
        log.warn("Configuring HTTPS with no validation!");
        SSLSocketFactory sf = new SSLSocketFactory(getSSLContext(), new AllowAllHostnameVerifier());
        Scheme https = new Scheme("https", 443, sf);
        httpClient.getConnectionManager().getSchemeRegistry().register(https);
      }

    }
View Full Code Here

    }

    final X509HostnameVerifier hostnameVerifier;
    switch (connectionInfo.getSslCertificateHostnameValidation()) {
      case NONE:
        hostnameVerifier = new AllowAllHostnameVerifier();
        break;
      case STRICT:
        hostnameVerifier = new StrictHostnameVerifier();
        break;
      default:
View Full Code Here

    }

    protected HttpClientConnectionManager buildConnectionManager() {
        Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
                .register("http", PlainConnectionSocketFactory.INSTANCE)
                .register("https", new SSLConnectionSocketFactory(fetcher.sslContext(), new AllowAllHostnameVerifier()))
                .build();

        DnsResolver dnsResolver = new ServerCacheResolver(fetcher.getServerCache());

        ManagedHttpClientConnectionFactory connFactory = new ManagedHttpClientConnectionFactory(){
View Full Code Here

      else
      {
         switch (policy)
         {
            case ANY:
               verifier = new AllowAllHostnameVerifier();
               break;
            case WILDCARD:
               verifier = new BrowserCompatHostnameVerifier();
               break;
            case STRICT:
               verifier = new StrictHostnameVerifier();
               break;
         }
      }
      try
      {
         SSLSocketFactory sslsf = null;
         SSLContext theContext = sslContext;
         if (disableTrustManager)
         {
            theContext = SSLContext.getInstance("SSL");
            theContext.init(null, new TrustManager[]{new PassthroughTrustManager()},
                    new SecureRandom());
            verifier =  new AllowAllHostnameVerifier();
            sslsf = new SSLSocketFactory(theContext, verifier);
         }
         else if (theContext != null)
         {
            sslsf = new SSLSocketFactory(theContext, verifier);
View Full Code Here

                .disableCookieManagement()
                .disableRedirectHandling()
                .setMaxConnTotal(maxConnections)
                .setDefaultSocketConfig(SocketConfig.custom().setSoTimeout(timeoutMilliseconds).build())
                .setSslcontext(buildAllowAnythingSSLContext())
                .setHostnameVerifier(new AllowAllHostnameVerifier());

        if (proxySettings != NO_PROXY) {
            HttpHost proxyHost = new HttpHost(proxySettings.host(), proxySettings.port());
            builder.setProxy(proxyHost);
        }
View Full Code Here

                                        return true;
                                    }
                                })
                                .build()
                )
                .setHostnameVerifier(new AllowAllHostnameVerifier())
                .build();
    }
View Full Code Here

  }

  private CloseableHttpClient prepareClient() throws KeyStoreException,
      NoSuchAlgorithmException, KeyManagementException {
    // install host name verifier that always approves host names
    AllowAllHostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier();
    // for SSL requests we should accept self-signed host certificates
    KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
    SSLContext sslContext = SSLContexts.custom()
        .loadTrustMaterial(trustStore, new TrustSelfSignedStrategy())
        .build();
View Full Code Here

   * @return
   * @throws CloudAdapterException
   */
  private CloseableHttpClient prepareAuthenticatingClient() throws Exception {
    // install host name verifier that always approves host names
    AllowAllHostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier();
    // for SSL requests we should accept self-signed host certificates
    KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
    SSLContextBuilder sslContextBuilder = SSLContexts.custom()
        .loadTrustMaterial(trustStore, new TrustSelfSignedStrategy());

View Full Code Here

    }
  }

  private CloseableHttpClient prepareClient() throws Exception {
    // install host name verifier that always approves host names
    AllowAllHostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier();
    // for SSL requests we should accept self-signed host certificates

    KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
    SSLContext sslContext = SSLContexts.custom()
        .loadTrustMaterial(trustStore, new TrustSelfSignedStrategy())
View Full Code Here

TOP

Related Classes of org.apache.http.conn.ssl.AllowAllHostnameVerifier

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.