Package org.apache.http.nio.conn.ssl

Examples of org.apache.http.nio.conn.ssl.SSLIOSessionStrategy


    private static Registry<SchemeIOSessionStrategy> convertRegistry(final SchemeRegistry oldRegistry) throws SSLInitializationException {
        SchemeRegistry baseRegistry = oldRegistry;
        //TODO: use values from old registry;
        Registry<SchemeIOSessionStrategy> defaultRegistry = RegistryBuilder.<SchemeIOSessionStrategy>create()
                .register("http", NoopIOSessionStrategy.INSTANCE)
                .register("https", new SSLIOSessionStrategy(
                                SSLContexts.createDefault(), null, null, SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER))
                .build();
        return defaultRegistry;
    }
View Full Code Here


                        tlsClientParameters = new TLSClientParameters();
                    }
                    final SSLContext sslcontext = getSSLContext(tlsClientParameters);
                    regBuilder
                        .register("https",
                                  new SSLIOSessionStrategy(sslcontext) {
                                @Override
                                protected void initializeEngine(SSLEngine engine) {
                                    initializeSSLEngine(sslcontext, engine);
                                }
                                @Override
View Full Code Here

                        System.getProperty("https.cipherSuites")) : null;
                X509HostnameVerifier hostnameVerifier = this.hostnameVerifier;
                if (hostnameVerifier == null) {
                    hostnameVerifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
                }
                sslStrategy = new SSLIOSessionStrategy(
                        sslcontext, supportedProtocols, supportedCipherSuites, hostnameVerifier);
            }
            final ConnectingIOReactor ioreactor = IOReactorUtils.create(
                defaultIOReactorConfig != null ? defaultIOReactorConfig : IOReactorConfig.DEFAULT);
            final PoolingNHttpClientConnectionManager poolingmgr = new PoolingNHttpClientConnectionManager(
View Full Code Here

        // Trust own CA and all self-signed certs
        SSLContext sslcontext = SSLContexts.custom()
                .loadTrustMaterial(trustStore, new TrustSelfSignedStrategy())
                .build();
        // Allow TLSv1 protocol only
        SSLIOSessionStrategy sslSessionStrategy = new SSLIOSessionStrategy(
                sslcontext,
                new String[] { "TLSv1" },
                null,
                SSLIOSessionStrategy.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
        CloseableHttpAsyncClient httpclient = HttpAsyncClients.custom()
View Full Code Here

        // Create a registry of custom connection session strategies for supported
        // protocol schemes.
        Registry<SchemeIOSessionStrategy> sessionStrategyRegistry = RegistryBuilder.<SchemeIOSessionStrategy>create()
            .register("http", NoopIOSessionStrategy.INSTANCE)
            .register("https", new SSLIOSessionStrategy(sslcontext, hostnameVerifier))
            .build();

        // Use custom DNS resolver to override the system DNS resolution.
        DnsResolver dnsResolver = new SystemDefaultDnsResolver() {
View Full Code Here

    @Override
    public void initConnectionManager() throws Exception {
        final Registry<SchemeIOSessionStrategy> schemereg = RegistryBuilder.<SchemeIOSessionStrategy>create()
                .register("http", NoopIOSessionStrategy.INSTANCE)
                .register("https", new SSLIOSessionStrategy(SSLTestContexts.createClientSSLContext()))
                .build();
        this.clientIOReactor = new DefaultConnectingIOReactor(this.clientReactorConfig);
        this.connMgr = new PoolingNHttpClientConnectionManager(this.clientIOReactor, schemereg);
    }
View Full Code Here

    @Override
    public void initConnectionManager() throws Exception {
        final Registry<SchemeIOSessionStrategy> schemereg = RegistryBuilder.<SchemeIOSessionStrategy>create()
                .register("http", NoopIOSessionStrategy.INSTANCE)
                .register("https", new SSLIOSessionStrategy(SSLTestContexts.createClientSSLContext()))
                .build();
        this.clientIOReactor = new DefaultConnectingIOReactor(this.clientReactorConfig);
        this.connMgr = new PoolingNHttpClientConnectionManager(this.clientIOReactor, schemereg);
    }
View Full Code Here

                        tlsClientParameters = new TLSClientParameters();
                    }
                    final SSLContext sslcontext = getSSLContext(tlsClientParameters);
                    regBuilder
                        .register("https",
                                  new SSLIOSessionStrategy(sslcontext) {
                                @Override
                                protected void initializeEngine(SSLEngine engine) {
                                    initializeSSLEngine(sslcontext, engine);
                                }
                                @Override
View Full Code Here

                        tlsClientParameters = new TLSClientParameters();
                    }
                    final SSLContext sslcontext = getSSLContext(tlsClientParameters);
                    regBuilder
                        .register("https",
                                  new SSLIOSessionStrategy(sslcontext) {
                                @Override
                                protected void initializeEngine(SSLEngine engine) {
                                    initializeSSLEngine(sslcontext, engine);
                                }
                                @Override
View Full Code Here

TOP

Related Classes of org.apache.http.nio.conn.ssl.SSLIOSessionStrategy

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.