Examples of AllowAllHostnameVerifier


Examples of net.lightbody.bmp.proxy.http.AllowAllHostnameVerifier

        hostNameResolver = new BrowserMobHostNameResolver(new Cache(DClass.ANY));

        this.socketFactory = new SimulatedSocketFactory(hostNameResolver, streamManager);
        this.sslSocketFactory = new TrustingSSLSocketFactory(hostNameResolver, streamManager);

        this.sslSocketFactory.setHostnameVerifier(new AllowAllHostnameVerifier());

        schemeRegistry.register(new Scheme("http", 80, socketFactory));
        schemeRegistry.register(new Scheme("https", 443, sslSocketFactory));

        httpClientConnMgr = new ThreadSafeClientConnManager(schemeRegistry) {
View Full Code Here

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

        }
        public void checkServerTrusted(X509Certificate[] chain,  String authType) throws CertificateException
        {
        }
      }}, new SecureRandom());
      SSLSocketFactory sf = new SSLSocketFactory(sslContext, new AllowAllHostnameVerifier());
      httpsScheme = new Scheme("https", 443, sf);
    }
    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
View Full Code Here

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

        }
        public void checkServerTrusted(X509Certificate[] chain,  String authType) throws CertificateException
        {
        }
      }}, new SecureRandom());
      SSLSocketFactory sf = new SSLSocketFactory(sslContext, new AllowAllHostnameVerifier());
      httpsScheme = new Scheme("https", 443, sf);
    }
    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
View Full Code Here

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

        }
        public void checkServerTrusted(X509Certificate[] chain,  String authType) throws CertificateException
        {
        }
      }}, new SecureRandom());
      SSLSocketFactory sf = new SSLSocketFactory(sslContext, new AllowAllHostnameVerifier());
      httpsScheme = new Scheme("https", 443, sf);
    }
    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
View Full Code Here

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

        }
        public void checkServerTrusted(X509Certificate[] chain,  String authType) throws CertificateException
        {
        }
      }}, new SecureRandom());
      SSLSocketFactory sf = new SSLSocketFactory(sslContext, new AllowAllHostnameVerifier());
      httpsScheme = new Scheme("https", 443, sf);
    }
    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
View Full Code Here

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

    public static Result create() {
        Logger.info("CREATE");
        HttpClient httpClient = new DefaultHttpClient();
        SSLSocketFactory sf = (SSLSocketFactory)httpClient.getConnectionManager()
                .getSchemeRegistry().getScheme("https").getSocketFactory();
        sf.setHostnameVerifier(new AllowAllHostnameVerifier());

        try {
            Logger.info("Creating comm");
            HttpPost request = new HttpPost(Application.baseRestUrl + "/communities");
            request.setHeader("Accept", "application/json");
View Full Code Here

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

    public static Result login() {
        HttpClient httpClient = new DefaultHttpClient();
        SSLSocketFactory sf = (SSLSocketFactory)httpClient.getConnectionManager()
                .getSchemeRegistry().getScheme("https").getSocketFactory();
        sf.setHostnameVerifier(new AllowAllHostnameVerifier());

        try {
            HttpPost request = new HttpPost(baseRestUrl + "/login");
            //{"email":"admin@dspace.org","password":"s3cret"}
            //StringEntity params =new StringEntity("{\"email\":\"admin@dspace.org\",\"password\":\"s3cret\"} ");
View Full Code Here

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

    public static Result logout() {
        HttpClient httpClient = new DefaultHttpClient();
        SSLSocketFactory sf = (SSLSocketFactory)httpClient.getConnectionManager()
                .getSchemeRegistry().getScheme("https").getSocketFactory();
        sf.setHostnameVerifier(new AllowAllHostnameVerifier());

        try {
            HttpPost request = new HttpPost(baseRestUrl + "/logout");
            request.addHeader("Content-Type", "application/json");
            String token = session("userToken");
View Full Code Here

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

    public static Result status() {
        HttpClient httpClient = new DefaultHttpClient();
        SSLSocketFactory sf = (SSLSocketFactory)httpClient.getConnectionManager()
                .getSchemeRegistry().getScheme("https").getSocketFactory();
        sf.setHostnameVerifier(new AllowAllHostnameVerifier());

        try {
            HttpGet request = new HttpGet(baseRestUrl + "/status");
            request.setHeader("Accept", "application/json");
            request.addHeader("content-type", "application/json");
View Full Code Here

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

    public RestResponse update(String token) throws IOException {
        //TODO insecure ssl hack
        HttpClient httpClient = new DefaultHttpClient();
        SSLSocketFactory sf = (SSLSocketFactory)httpClient.getConnectionManager()
                .getSchemeRegistry().getScheme("https").getSocketFactory();
        sf.setHostnameVerifier(new AllowAllHostnameVerifier());

        HttpPut request = new HttpPut(Application.baseRestUrl + "/communities/" + this.id);
        request.setHeader("Accept", "application/json");
        request.addHeader("Content-Type", "application/json");
        request.addHeader("rest-dspace-token", token);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.