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 <[EMAIL PROTECTED]> 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("<b>Hello World</b>");
> }
> };
> from("jetty:https://localhost:8080/hello").process(proc);
>
>
> [1] http://issues.apache.org/activemq/browse/CAMEL
>
>
> On 26/03/2008, Micky Santomax <[EMAIL PROTECTED]> 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