Hi,

I am trying to use camel HTTP4 component with SSL. The certificates are set
up on client and server for 2 way SSL and followingis the client side code.

CamelContext camelCtx = new DefaultCamelContext();
                KeyStoreParameters ksp = new KeyStoreParameters();
                ksp.setResource("C:\\work\\client.jks");
                ksp.setPassword("client");
                KeyManagersParameters kmp = new KeyManagersParameters();
                kmp.setKeyStore(ksp);
                kmp.setKeyPassword("client");
                SSLContextParameters scp = new SSLContextParameters();
                scp.setKeyManagers(kmp);
                HttpComponent httpComponent = camelCtx.getComponent("https4",
HttpComponent.class);
                httpComponent.setSslContextParameters(scp);
                
                try {
                        
                        Exchange exchange =
camelCtx.createProducerTemplate().send("https4://localhost:8443", new
Processor() {
                    public void process(Exchange exchange) throws Exception {
                        exchange.getIn().setHeader(Exchange.HTTP_METHOD, "GET");
                    }
                        });

                        System.out.println("Object is " + exchange);
                        
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                
                
                System.out.println("Complete!!!!!!");
        }


I am always getting a null pointer exception on teh line I create the
exchange and send. Any idea what is going wrong here. This is a simple HTTPS
service which returns some xml data. Outside of Camel I tested this service
from browser and it works fine. 

Can someone point out whats wrong in this code?

Regards
Kiran 

--
View this message in context: 
http://camel.465427.n5.nabble.com/HTTPS-Usage-tp5499772p5499772.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to