Package org.apache.cxf.configuration.jsse

Examples of org.apache.cxf.configuration.jsse.TLSClientParameters


                break;
            }
           
        }
        // check tlsClientParameters from message header
        TLSClientParameters clientParameters = message.get(TLSClientParameters.class);
        if (clientParameters == null) {
            clientParameters = tlsClientParameters;
        }
        if (uri.getScheme().equals("https")
            && clientParameters != null
            && clientParameters.getSSLSocketFactory() != null) {
            //if they configured in an SSLSocketFactory, we cannot do anything
            //with it as the NIO based transport cannot use socket created from
            //the SSLSocketFactory.
            o = false;
        }
View Full Code Here


        session = null;
        return ctx;
    }

    public void initializeSSLEngine(SSLContext sslcontext, SSLEngine sslengine) {
        TLSClientParameters tlsClientParameters = getTlsClientParameters();
        if (tlsClientParameters == null) {
            tlsClientParameters = new TLSClientParameters();
        }
        String[] cipherSuites = SSLUtils.getCiphersuites(tlsClientParameters.getCipherSuites(),
                                                         SSLUtils.getSupportedCipherSuites(sslcontext),
                                                         tlsClientParameters.getCipherSuitesFilter(), LOG, false);
        sslengine.setEnabledCipherSuites(cipherSuites);
    }
View Full Code Here

                                   ? url.openConnection(proxy)
                                   : url.openConnection());
        if (HTTPS_URL_PROTOCOL_ID.equals(url.getProtocol())) {
           
            if (tlsClientParameters == null) {
                tlsClientParameters = new TLSClientParameters();
            }

            Exception ex = null;
            try {
                decorateWithTLS(tlsClientParameters, connection);
View Full Code Here

                wrappedStream = cachedStream;
            }
        }
       
        protected TLSClientParameters findTLSClientParameters() {
            TLSClientParameters clientParameters = outMessage.get(TLSClientParameters.class);
            if (clientParameters == null) {
                clientParameters = getTlsClientParameters();
            }
            if (clientParameters == null) {
                clientParameters = new TLSClientParameters();
            }
            return clientParameters;
        }
View Full Code Here

            return clientParameters;
        }

        protected void connect(boolean output) {
            if (url.getScheme().equals("https")) {
                TLSClientParameters clientParameters = findTLSClientParameters();
                bootstrap.handler(new NettyHttpClientPipelineFactory(clientParameters));
            } else {
                bootstrap.handler(new NettyHttpClientPipelineFactory(null));
            }
            ChannelFuture connFuture =
View Full Code Here

        store.load(new FileInputStream(trustStoreFile), password.toCharArray());
        return store;
    }
   
    private SSLContext createSSLContext() throws Exception {
        TLSClientParameters tlsParams = new TLSClientParameters();
       
        KeyStore trustStore = loadStore("src/test/java/org/apache/cxf/systest/http/resources/Truststore.jks",
            "password");
       
        TrustManagerFactory tmf =
            TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
        tmf.init(trustStore);
        tlsParams.setTrustManagers(tmf.getTrustManagers());
       
        KeyStore keyStore = loadStore("src/test/java/org/apache/cxf/systest/http/resources/Morpit.jks",
            "password");
       
        KeyManagerFactory kmf =
            KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
        kmf.init(keyStore, "password".toCharArray());
        tlsParams.setKeyManagers(kmf.getKeyManagers());
       
        return SSLUtils.getSSLContext(tlsParams);
    }
View Full Code Here

            (HTTPConduit) client.getConduit();
       
        HTTPClientPolicy httpClientPolicy = http.getClient();
        assertEquals("the httpClientPolicy's autoRedirect should be true",
                     true, httpClientPolicy.isAutoRedirect());
        TLSClientParameters tlsParameters = http.getTlsClientParameters();
        assertNotNull("the http conduit's tlsParameters should not be null", tlsParameters);
       
       
        // If we set any name, but Edward, Mary, or George,
        // and a password of "password" we will get through
View Full Code Here

            (HTTPConduit) client.getConduit();
       
        HTTPClientPolicy httpClientPolicy = http.getClient();
        assertEquals("the httpClientPolicy's autoRedirect should be true",
                     true, httpClientPolicy.isAutoRedirect());
        TLSClientParameters tlsParaments = http.getTlsClientParameters();
        assertNotNull("the http conduite's tlsParaments should not be null", tlsParaments);
       
       
        // If we set any name, but Edward, Mary, or George,
        // and a password of "password" we will get through
View Full Code Here

        }
        if (address == null) {
            useHttps = configuredConduit.getTlsClientParameters() != null;
        }
        if (useHttps) {
            TLSClientParameters params = configuredConduit.getTlsClientParameters();
            if (params == null) {
                params = new TLSClientParameters(); //use defaults
            }
            fac = new HttpsURLConnectionFactory(params);
        } else {
            fac = new HttpURLConnectionFactoryImpl();
        }
View Full Code Here

        HTTPConduit conduit = new URLConnectionHTTPConduit(bus, ei, null);
        conduit.finalizeConfig();
   
        Message message = getNewMessage();
        // We need an SSL policy, or we can't use "https".
        conduit.setTlsClientParameters(new TLSClientParameters());
       
        // Test call
        conduit.prepare(message);
       
        return message.get("http.connection");
View Full Code Here

TOP

Related Classes of org.apache.cxf.configuration.jsse.TLSClientParameters

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.