Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 14877 invoked from network); 3 Jun 2010 06:31:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Jun 2010 06:31:58 -0000 Received: (qmail 41332 invoked by uid 500); 3 Jun 2010 06:31:58 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 41207 invoked by uid 500); 3 Jun 2010 06:31:56 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 41194 invoked by uid 99); 3 Jun 2010 06:31:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jun 2010 06:31:55 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jun 2010 06:31:48 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OK3xf-0001cL-DQ for users@camel.apache.org; Wed, 02 Jun 2010 23:31:27 -0700 Message-ID: <28763634.post@talk.nabble.com> Date: Wed, 2 Jun 2010 23:31:27 -0700 (PDT) From: "M.Ismail" To: users@camel.apache.org Subject: Re: http component SSL problem In-Reply-To: <28733226.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: mohammed.hany@gmail.com References: <28733226.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, Solved this problem using good old System.setProperty and Security.addProvider. Thus, I don't use httpClientConfigurerRef=HttpClientConfigurer nor httpClientConfigurerRef=HttpClientConfigurer and no not-yet-commons-ssl-0.3.11 ! Should the camel-http documentation be updated? M.Ismail M.Ismail wrote: > > Hi, > > > I'm using the camel-http component to communicate with an SSL web service > and I'm receiving the following exception: > > java.security.KeyStoreException: No private keys found in keystore! > at > org.apache.commons.ssl.KeyStoreBuilder.validate(KeyStoreBuilder.java:269) > at > org.apache.commons.ssl.KeyStoreBuilder.build(KeyStoreBuilder.java:129) > at org.apache.commons.ssl.KeyMaterial.(KeyMaterial.java:179) > at org.apache.commons.ssl.KeyMaterial.(KeyMaterial.java:170) > at org.apache.commons.ssl.KeyMaterial.(KeyMaterial.java:160) > at org.apache.commons.ssl.KeyMaterial.(KeyMaterial.java:64) > at org.apache.commons.ssl.KeyMaterial.(KeyMaterial.java:139) > at > org.apache.commons.httpclient.contrib.ssl.AuthSSLProtocolSocketFactory.(AuthSSLProtocolSocketFactory.java:191) > at > tutorial.HttpClientConfigurer.configureHttpClient(HttpClientConfigurer.java:22) > at > org.apache.camel.component.http.CompositeHttpConfigurer.configureHttpClient(CompositeHttpConfigurer.java:40) > at > org.apache.camel.component.http.HttpEndpoint.createHttpClient(HttpEndpoint.java:105) > at > org.apache.camel.component.http.HttpProducer.(HttpProducer.java:56) > at > org.apache.camel.component.http.HttpEndpoint.createProducer(HttpEndpoint.java:75) > at > org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:196) > at > org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:133) > at > org.apache.camel.processor.SendProcessor.doProcess(SendProcessor.java:94) > at > org.apache.camel.processor.SendProcessor.process(SendProcessor.java:82) > at > org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67) > at > org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53) > at > org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:82) > at > org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:93) > at > org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67) > at > org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:228) > at org.apache.camel.processor.Pipeline.process(Pipeline.java:74) > at > org.apache.camel.processor.TryProcessor.process(TryProcessor.java:63) > at > org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67) > at > org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53) > at > org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:82) > at > org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:93) > at > org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67) > at > org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:228) > at > org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:66) > at > org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48) > at > org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67) > at > org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.messageReceived(MinaConsumer.java:110) > at > org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570) > at > org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) > at > org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) > at > org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) > at > org.apache.mina.filter.LoggingFilter.messageReceived(LoggingFilter.java:89) > at > org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) > at > org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) > at > org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) > at > org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220) > at > org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) > at java.lang.Thread.run(Thread.java:595) > > I have implemented the interface HttpClientConfigurer and here it is: > package tutorial; > > import java.io.IOException; > import java.net.MalformedURLException; > import java.net.URL; > import java.security.GeneralSecurityException; > > import org.apache.commons.httpclient.HttpClient; > import org.apache.commons.httpclient.protocol.Protocol; > import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; > import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; > import org.apache.commons.httpclient.contrib.ssl.*; > import org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory; > > public class HttpClientConfigurer implements > org.apache.camel.component.http.HttpClientConfigurer { > > public void configureHttpClient(HttpClient client) { > // register the customer SSLFactory > Protocol authhttps; > try { > authhttps = new Protocol("https", > (ProtocolSocketFactory) new AuthSSLProtocolSocketFactory( > new URL("file:./src/main/resources/ClientKey.jks"), > "pwd", > new URL("file:./src/main/resources/ClientTrust.jks"), > "pwd"), 443); > Protocol.registerProtocol("https", authhttps); > } catch (MalformedURLException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (GeneralSecurityException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (IOException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > // ProtocolSocketFactory easy = new EasySSLProtocolSocketFactory(); > // Protocol protocol = new Protocol("https", easy, 8443); > // Protocol.registerProtocol("https", protocol); > > } > } > > and here is the camel-context: > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:camel="http://camel.apache.org/schema/spring" > xmlns:broker="http://activemq.apache.org/schema/core" > xsi:schemaLocation=" > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd > http://camel.apache.org/schema/spring > http://camel.apache.org/schema/spring/camel-spring.xsd > http://activemq.apache.org/schema/core > http://activemq.apache.org/schema/core/activemq-core.xsd"> > > > > > > > > > > > > > > > and my route builder is : > > from("mina:tcp://0.0.0.0:9002?sync=true&lazySessionCreation=true&minaLogger=true&textline=true&encoderMaxLineLength=50000&decoderMaxLineLength=50000&textlineDelimiter=WINDOWS&encoding=US-ASCII") > .process(new transformationProcessor()) > .to("https://"+strIP+"/?httpClient.authenticationPreemptive=true&httpClientConfigurerRef=HttpClientConfigurer"); > > I'm using camel 2.2.0 and I use not-yet-commons-ssl version 0.3.11. I can > send you the whole pom.xml if you want. > > I think that this problem has to do with not-yet-commons-ssl since, I have > searched for this error and the closest I found is: > http://old.nabble.com/No-private-keys-found-in-keystore-td18165598.html > > both the keystore and the trust store files and password are running > correctly in an older application using System properties e.g. > System.setProperty("javax.net.ssl.keyStore", "ClientKey.jks"); and the > Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider() ); > > Any suggestions? > -- View this message in context: http://old.nabble.com/http-component-SSL-problem-tp28733226p28763634.html Sent from the Camel - Users mailing list archive at Nabble.com.