camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-407) Password error for jetty:https endpoint
Date Wed, 02 Apr 2008 12:13:32 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41965#action_41965
] 

Gary Tully commented on CAMEL-407:
----------------------------------

for: Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
see a good explination @ http://blogs.sun.com/andreas/entry/no_more_unable_to_find

Essentially the problem is that the cert is self signed or does not use a hostname as the
CN component. The blog post and referenced code should help.

For my test I used a a jetty client (which uses apache commons httpclient) and added a protocol
handler that will not validate the servers cert. Configuring the default jdk httpClient is
probably a little different.

return new RouteBuilder() {
            public void configure() {
                
                Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(),
8080);
                Protocol.registerProtocol("https", easyhttps);
                
                
                from("jetty:https://localhost:8080/test").to("mock:a");

                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);
            }
        };

where EasySSLProtocolSocketFactory is @ http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java?view=markup

more doco for httpClient @ http://hc.apache.org/httpclient-3.x/sslguide.html

This is all to work around the use of a self-signed cert which is a little bogus.

The alternative is to use a real valid signed cert from one of the approved authorities and
add it to the keystore.


> Password error for jetty:https endpoint
> ---------------------------------------
>
>                 Key: CAMEL-407
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-407
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-jetty
>    Affects Versions: 1.3.0
>            Reporter: Micky Santomax
>            Priority: Critical
>             Fix For: 1.3.0
>
>         Attachments: TestHttpsRoute.java
>
>
> I've defined an http endpoint by this code :
>         this.from("jetty:https://localhost:8193/SSLTest/")
>               .process(new Processor());
> When I install my application in Tomcat 6.0.13 it throws this exception :
> 2008-03-18 20:05:42.998::WARN:  EXCEPTION
> java.security.UnrecoverableKeyException: Password must not be null
>         at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:107)
>         at sun.security.provider.JavaKeyStore$JKS.engineGetKey(JavaKeyStore.java:38)
>         at java.security.KeyStore.getKey(KeyStore.java:763)
>         at com.sun.net.ssl.internal.ssl.SunX509KeyManagerImpl.<init>(SunX509KeyManagerImpl.java:113)
>         at com.sun.net.ssl.internal.ssl.KeyManagerFactoryImpl$SunX509.engineInit(KeyManagerFactoryImpl.java:48)
>         at javax.net.ssl.KeyManagerFactory.init(KeyManagerFactory.java:239)
>         at org.mortbay.jetty.security.SslSocketConnector.createFactory(SslSocketConnector.java:202)
>         at org.mortbay.jetty.security.SslSocketConnector.newServerSocket(SslSocketConnector.java:407)
>         at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
>         at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:272)
>         at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
>         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
>         at org.apache.camel.component.jetty.JettyHttpComponent.connect(JettyHttpComponent.java:98)
>         at org.apache.camel.component.http.HttpEndpoint.connect(HttpEndpoint.java:80)
>         at org.apache.camel.component.http.HttpConsumer.doStart(HttpConsumer.java:50)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:51)
>         at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:64)
>         at org.apache.camel.impl.DefaultCamelContext.startRoutes(DefaultCamelContext.java:461)
>         at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:435)
>         at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:140)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:51)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:96)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
>         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
>         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
>         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
>         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
>         at it.unibas.springfreesbee.ContextStartup.contextInitialized(ContextStartup.java:43)
>         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
>         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
>         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
>         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
>         at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
>         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:511)
>         at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1220)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
>         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
>         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
>         at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1458)
>         at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:820)
>         at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:354)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:619)
> 2008-03-18 20:05:42.012::WARN:  failed SslSocketConnector@0.0.0.0:8193
> java.io.IOException: Could not create JsseListener: java.security.UnrecoverableKeyException:
Password must not be null
>         at org.mortbay.jetty.security.SslSocketConnector.newServerSocket(SslSocketConnector.java:446)
>         at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
>         at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:272)
>         at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
>         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
>         at org.apache.camel.component.jetty.JettyHttpComponent.connect(JettyHttpComponent.java:98)
>         at org.apache.camel.component.http.HttpEndpoint.connect(HttpEndpoint.java:80)
>         at org.apache.camel.component.http.HttpConsumer.doStart(HttpConsumer.java:50)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:51)
>         at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:64)
>         at org.apache.camel.impl.DefaultCamelContext.startRoutes(DefaultCamelContext.java:461)
>         at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:435)
>         at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:140)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:51)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:96)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
>         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
>         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
>         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
>         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
>         at it.unibas.springfreesbee.ContextStartup.contextInitialized(ContextStartup.java:43)
>         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
>         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
>         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
>         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
>         at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
>         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:511)
>         at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1220)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
>         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
>         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
>         at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1458)
>         at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:820)
>         at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:354)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:619)
> ERROR [it.unibas.springfreesbee.ContextStartup - contextInitialized] - org.apache.camel.RuntimeCamelException:
java.io.IOException: Could not create JsseListener: java.security.UnrecoverableKeyException:
Password must not be null
> I have follow all steps of jetty ssl configuration, but the error is the same with both
keytool and openssl applications.
> I think that problems are in routing because if I set only 
>      this.from("jetty:https://localhost:8193/SSLTest/"); 
> There aren't installation problems in Tomcat, when I access to the endpoint by browser
it ask the acceptance of certificate. In this case there is another exception at runtime :
> 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message