@@ -0,0 +1,2396 @@
+package camelinaction;%0A%0Aimport org.apache.camel.CamelContext;%0Aimport org.apache.camel.SSLContextParametersAware;%0Aimport org.apache.camel.builder.RouteBuilder;%0Aimport org.apache.camel.test.junit4.CamelTestSupport;%0Aimport org.apache.camel.util.jsse.KeyManagersParameters;%0Aimport org.apache.camel.util.jsse.KeyStoreParameters;%0Aimport org.apache.camel.util.jsse.SSLContextParameters;%0Aimport org.apache.camel.util.jsse.TrustManagersParameters;%0Aimport org.junit.Test;%0A%0Apublic class GlobalSSLContextParametersTest extends CamelTestSupport %7B%0A    %0A    protected CamelContext createCamelContext() throws Exception %7B%0A        CamelContext context = super.createCamelContext();%0A        context.setSSLContextParameters(createSSLContextParameters());%0A        ((SSLContextParametersAware) context.getComponent(%22jetty%22)).setUseGlobalSslContextParameters(true);%0A        return context;%0A    %7D%0A    %0A    private SSLContextParameters createSSLContextParameters() %7B%0A        KeyStoreParameters ksp = new KeyStoreParameters();%0A        ksp.setResource(%22./cia_keystore.jks%22);%0A        ksp.setPassword(%22supersecret%22);%0A        KeyManagersParameters kmp = new KeyManagersParameters();%0A        kmp.setKeyPassword(%22secret%22);%0A        kmp.setKeyStore(ksp);%0A%0A        KeyStoreParameters tsp = new KeyStoreParameters();%0A        tsp.setResource(%22./cia_truststore.jks%22);%0A        tsp.setPassword(%22supersecret%22);      %0A        TrustManagersParameters tmp = new TrustManagersParameters();%0A        tmp.setKeyStore(tsp);%0A        %0A        SSLContextParameters sslContextParameters = new SSLContextParameters();%0A        sslContextParameters.setKeyManagers(kmp);%0A        sslContextParameters.setTrustManagers(tmp);%0A        %0A        return sslContextParameters;%0A    %7D%0A%0A    // this will utilize the truststore we defined globally using setUseGlobalSslContextParameters to access the HTTPS endpoint%0A    @Test%0A    public void testHttps() throws Exception %7B%0A        String reply = template.requestBody(%22jetty:https://localhost:8080/early%22, %22Hi Camel!%22, String.class);%0A        assertEquals(%22Hi%22, reply);%0A    %7D%0A    %0A    @Override%0A    protected RouteBuilder createRouteBuilder() throws Exception %7B%0A        return new RouteBuilder() %7B%0A            @Override%0A            public void configure() throws Exception %7B%0A                from(%22jetty:https://localhost:8080/early%22)%0A                    .transform().constant(%22Hi%22);%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

add test using GlobalSSLContextParameters