camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apache999 <>
Subject Re: HTTP basic authorization with HTTP4?
Date Thu, 14 Aug 2014 14:48:45 GMT
Thanks Willem.  I was having issues configuring the keystore and truststore. 
I tried implementing the HttpClientConfigurer below but I am not seeing the
keystore and specified truststore loading up in the during
SSL handshake.  I only see the default jre/lib/security/cacerts truststore
loading up.  
Am I missing anything in MyHttpClientConfigurer or MyRouteBuilder. Or
possible in MainApp?  

public class MyHttpClientConfigurer implements HttpClientConfigurer {
    public void configureHttpClient(HttpClientBuilder client) {
        try {
		KeyStore keystore = KeyStore.getInstance("PKCS12");
	    keystore.load(new FileInputStream(new
File("/etc/httpd/ssl/WS1909634885._.1.p12")), "password".toCharArray());

		KeyStore truststore = KeyStore.getInstance("JKS");;
        truststore.load(new FileInputStream(new

		SchemeRegistry registry = new SchemeRegistry();
		registry.register(new Scheme("https", 443, new SSLSocketFactory(keystore,
"password", truststore)));
	} catch(Exception e) {
		System.out.println("In configureHttpClient" + e);

public class MyRouteBuilder extends RouteBuilder {
    public void configure() {	 
    private void configureSslForHttp4()
	HttpComponent httpComponent = getContext().getComponent("http4",
	httpComponent.setHttpClientConfigurer(new MyHttpClientConfigurer());

public class MainApp {
    public static void main(String... args) throws Exception {
        Main main = new Main();
        main.addRouteBuilder(new MyRouteBuilder());;
        System.out.println("MainApp started - Hello");

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message