Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 91591 invoked from network); 27 Mar 2008 13:09:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2008 13:09:17 -0000 Received: (qmail 54762 invoked by uid 500); 27 Mar 2008 13:09:16 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 54740 invoked by uid 500); 27 Mar 2008 13:09:16 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 54731 invoked by uid 99); 27 Mar 2008 13:09:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2008 06:09:16 -0700 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=SPF_PASS,WEIRD_PORT,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of james.strachan@gmail.com designates 64.233.170.190 as permitted sender) Received: from [64.233.170.190] (HELO rn-out-0910.google.com) (64.233.170.190) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2008 13:08:34 +0000 Received: by rn-out-0910.google.com with SMTP id e21so2736031rng.6 for ; Thu, 27 Mar 2008 06:08:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=3uEpm3MnO8Xljr1FzOnpKVLqEeEj3NYso18Z8N2jUVo=; b=tY7kLHJ0L89xtoUgAqN4wsGIY453yIp5ghYuPx8GxZrK4OyzA3niXch5M94nzrHwJgXXm1jzsFiOgE63YwgagUMYh3wrNENXgu+Z/5dMhyznJpMKifd667/etQB0wGkM+ph5tUoMWC6HDHFouV5uJtktvcuq/WS638JcZjmLcoc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ml+3K1mVfS+mbGcBT7wiBL0xrjJiW358X49iQQrv7NrP7yp60CFzp8IXgdXgNXK1OZ8CTsbTxmw6ZbMfOCmP7HZouVX4+FvGtzHA2flDM13cbK+6WPq6W56VRlQZpf5NmfGQZhz7+Q6M48U51fqNx5et5lfq6GoVxwSwrMJjCus= Received: by 10.150.133.17 with SMTP id g17mr797971ybd.27.1206623325140; Thu, 27 Mar 2008 06:08:45 -0700 (PDT) Received: by 10.150.148.20 with HTTP; Thu, 27 Mar 2008 06:08:45 -0700 (PDT) Message-ID: Date: Thu, 27 Mar 2008 13:08:45 +0000 From: "James Strachan" To: camel-user@activemq.apache.org Subject: Re: Password error for https endpoint connection In-Reply-To: <3a73c17c0803270548w714da4edn7c53465182165396@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <16128569.post@talk.nabble.com> <3a73c17c0803260822q501ad8a4p250260ba78a6aa2f@mail.gmail.com> <16309438.post@talk.nabble.com> <3a73c17c0803270548w714da4edn7c53465182165396@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Awesome patch, thanks Gary! :) I've applied your patch to trunk. I made a minor change to use a property on the JettyHttpComponent for the sslPassword and sslKeyPassword so folks can customize then in Java / Spring if they want; but have defaulted them to "". I tried copying the HttpRouteTest to be HttpsRouteTest and changing http:// to https:// and the test just hangs though - I guess something else needs to be done to enable Jetty to support https? (Just wondering how to get a test case for https working). On 27/03/2008, Gary Tully wrote: > I think you should open a jira[1] for the password null issue. I think > it is a bug. > > > 2008-03-18 20:05:42.998::WARN: EXCEPTION > > > java.security.UnrecoverableKeyException: Password must not be null > > > to create a jetty https endpoint that uses a password to access its > keystore I needed to modify the JettyHttpComponent as follows: > > Index: src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java > =================================================================== > --- src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java > (revision 641579) > +++ src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java > (working copy) > @@ -89,7 +89,10 @@ > if (connectorRef == null) { > Connector connector; > if ("https".equals(endpoint.getProtocol())) { > - connector = new SslSocketConnector(); > + SslSocketConnector sslConnector = new SslSocketConnector(); > + sslConnector.setPassword(""); > + sslConnector.setKeyPassword(""); > + connector = sslConnector; > } else { > connector = new SelectChannelConnector(); > } > > > This allowed the SslSocketConnector to make use of the jetty system > properties for passwords: -Djetty.ssl.password=... and > -Djetty.ssl.keypassword=... > In the absence of the system properties, there is a prompt to StdIn. > > > I was able to use a browser to access the following route: > > Processor proc = new Processor() { > public void process(Exchange exchange) throws Exception { > exchange.getOut(true).setBody("Hello World"); > } > }; > from("jetty:https://localhost:8080/hello").process(proc); > > > [1] http://issues.apache.org/activemq/browse/CAMEL > > > On 26/03/2008, Micky Santomax wrote: > > > > Thanks for reply > > > > I've follow all step of jetty ssl configuration but the problem isn't > > changed > > After various test I've see that the problem is in routing because if in > > RouteBuilder class I set this : > > > > JettyHttpEndpoint jettyEndpoint = > > context.getEndpoint("jetty:https://localhost:8196/SSLTest/", > > JettyHttpEndpoint.class); > > > > this.from(jettyEndpoint); > > > > The endpoint was created and when I access to it with browser I receive a > > request of accept the certificate. If I accept it I receive the following > > error : > > > > 2008-03-26 18:56:14.933::WARN: handle failed > > java.lang.NullPointerException > > at > > org.mortbay.thread.BoundedThreadPool.isLowOnThreads(BoundedThreadPool.java:216) > > at > > org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:218) > > at > > org.mortbay.jetty.security.SslSocketConnector$SslConnection.run(SslSocketConnector.java:620) > > at > > org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) > > > > Else if I set this : > > > > JettyHttpEndpoint jettyEndpoint = > > context.getEndpoint("jetty:https://localhost:8196/SSLTest/", > > JettyHttpEndpoint.class); > > > > this.from(jettyEndpoint).process(new > > MyProcessor()).to("jetty:http://localhost:8195/SSLTest2/"); > > > > or > > > > this.from(jettyEndpoint).to("jetty:http://localhost:8195/SSLTest2/"); > > > > I receive the previous error : > > > > > > 2008-03-18 20:05:42.998::WARN: EXCEPTION > > > java.security.UnrecoverableKeyException: Password must not be null > > > > -- > > View this message in context: http://www.nabble.com/Password-error-for-https-endpoint-connection-tp16128569s22882p16309438.html > > > > Sent from the Camel - Users mailing list archive at Nabble.com. > > > > > -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com