Package org.apache.http.conn.ssl

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


  static DefaultHttpClient httpClient = null;

  private ApacheHttpClient() throws KeyManagementException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException{
    // Allow self-signed SSL certificates:
    TrustStrategy trustStrategy = new TrustSelfSignedStrategy();
    X509HostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier();
    SSLSocketFactory sslSf = new SSLSocketFactory(trustStrategy,
          hostnameVerifier);
    Scheme https = new Scheme("https", 443, sslSf);

    SchemeRegistry schemeRegistry = SchemeRegistryFactory
View Full Code Here


  private ApacheHttpClient() throws KeyManagementException,
      UnrecoverableKeyException, NoSuchAlgorithmException,
      KeyStoreException {
    // Allow self-signed SSL certificates:
    TrustStrategy trustStrategy = new TrustSelfSignedStrategy();
    X509HostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier();
    SSLSocketFactory sslSf = new SSLSocketFactory(trustStrategy,
        hostnameVerifier);
    Scheme https = new Scheme("https", 443, sslSf);
   
    SchemeRegistry schemeRegistry = SchemeRegistryFactory.createDefault();
View Full Code Here

        HttpContext httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContextRef", HttpContext.class);
        if (httpContext == null) {
            httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContext", HttpContext.class);
        }

        X509HostnameVerifier x509HostnameVerifier = resolveAndRemoveReferenceParameter(parameters, "x509HostnameVerifier", X509HostnameVerifier.class);
        if (x509HostnameVerifier == null) {
            x509HostnameVerifier = getX509HostnameVerifier();
        }
       
        SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters, "sslContextParametersRef", SSLContextParameters.class);
View Full Code Here

            return verifier.verify(s, sslSession);
        }
    }

    public HttpClient build() {
        X509HostnameVerifier verifier = null;
        if (this.verifier != null) verifier = new VerifierWrapper(this.verifier);
        else {
            switch (policy) {
                case ANY:
                    verifier = new AllowAllHostnameVerifier();
View Full Code Here

            return verifier.verify(s, sslSession);
        }
    }

    public HttpClient build() {
        X509HostnameVerifier verifier = null;
        if (this.verifier != null) verifier = new VerifierWrapper(this.verifier);
        else {
            switch (policy) {
                case ANY:
                    verifier = new AllowAllHostnameVerifier();
View Full Code Here

                public X509Certificate[] getAcceptedIssuers() {
                    return null;
                }
            };
            X509HostnameVerifier verifier = new X509HostnameVerifier() {
                @Override
                public void verify(String string, SSLSocket ssls) throws IOException {
                }
View Full Code Here

        HttpContext httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContextRef", HttpContext.class);
        if (httpContext == null) {
            httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContext", HttpContext.class);
        }

        X509HostnameVerifier x509HostnameVerifier = resolveAndRemoveReferenceParameter(parameters, "x509HostnameVerifier", X509HostnameVerifier.class);
        if (x509HostnameVerifier == null) {
            x509HostnameVerifier = getX509HostnameVerifier();
        }
       
        SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters, "sslContextParametersRef", SSLContextParameters.class);
View Full Code Here

        HttpContext httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContextRef", HttpContext.class);
        if (httpContext == null) {
            httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContext", HttpContext.class);
        }

        X509HostnameVerifier x509HostnameVerifier = resolveAndRemoveReferenceParameter(parameters, "x509HostnameVerifier", X509HostnameVerifier.class);
        if (x509HostnameVerifier == null) {
            x509HostnameVerifier = getX509HostnameVerifier();
        }

        // TODO cmueller: remove the "sslContextParametersRef" look up in Camel 3.0
View Full Code Here

          new AuthScope(SERVER_HOSTNAME, portConfig.getPort()),
          new UsernamePasswordCredentials(portConfig.getUser().getUsername(), portConfig.getUser().getPassword()));

      // Allow all hostnames in CN; this is okay as long as hostname is localhost/127.0.0.1!
      // See: https://github.com/syncany/syncany/pull/196#issuecomment-52197017
      X509HostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier();

      // Fetch the SSL context (using the user key/trust store)
      SSLContext sslContext = UserConfig.createUserSSLContext();

      // Create client with authentication details
View Full Code Here

            if (sslSocketFactory == null) {
                final String[] supportedProtocols = systemProperties ? split(
                        System.getProperty("https.protocols")) : null;
                final String[] supportedCipherSuites = systemProperties ? split(
                        System.getProperty("https.cipherSuites")) : null;
                X509HostnameVerifier hostnameVerifier = this.hostnameVerifier;
                if (hostnameVerifier == null) {
                    hostnameVerifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
                }
                if (sslcontext != null) {
                    sslSocketFactory = new SSLConnectionSocketFactory(
View Full Code Here

TOP

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

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.