Hi
On 24/10/12 19:34, rxm0203 wrote:
Hello All,

I am trying to configure HTTPS for multiple OSGi bundles containing RESTful
web services through PAX Web. These bundles are deployed in
apache-servicemix-4.4.1-fuse-02-05 (Camel version 2.8 and CXF version
2.4.3.)  Here is a sample route from one bundle.

  <cxf:rsServer id="rsServer" address="${ws.address}"
serviceClass="net.examples.ServiceResource"/>
   <camelContext xmlns="http://camel.apache.org/schema/spring";>
     <route id="control">
       <from uri="cxfrs:bean:rsServer"/>
       <log  message="Processing Request" />
       <to uri="controllerBean"/>
     </route>
   </camelContext>

Address for<rsServer>  is injected from properties file. The value for
address in properties file is https://0.0.0.0:443/example


the servlet transport is bypassed when an absolute address is used, I think an address like "/example" can work better, can you try it please ?

Cheers, Sergey

The contents of PAX Web configuration file under<KARAF.HOME>/etc folder are
as follows:

org.osgi.service.http.enabled=false
org.osgi.service.http.port=8181

org.osgi.service.http.secure.enabled=true
org.osgi.service.http.port.secure=443

org.ops4j.pax.web.ssl.keystore=etc/file.keystore
org.ops4j.pax.web.ssl.keystore.type=JKS
org.ops4j.pax.web.ssl.password=password
org.ops4j.pax.web.ssl.keypassword=keyPassword

javax.servlet.context.tempdir=data/pax-web-jsp

I see following error in ServiceMix log file on start up from all OSGi
bundles.

Caused by: java.lang.RuntimeException: Protocol mismatch for port 443:
engine's protocol is http, the url protocol is https
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.finalizeConfig(JettyHTTPDestination.java:150)[133:org.apache.cxf.bundle:2.4.3.fuse-01-02]
        at
org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:284)[133:org.apache.cxf.bundle:2.4.3.fuse-01-02]
        at
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:93)[133:org.apache.cxf.bundle:2.4.3.fuse-01-02]
        at
org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:72)[133:org.apache.cxf.bundle:2.4.3.fuse-01-02]
        at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:149)[133:org.apache.cxf.bundle:2.4.3.fuse-01-02]
        ... 26 more
Caused by: java.io.IOException: Protocol mismatch for port 443: engine's
protocol is http, the url protocol is https
        at
org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:254)[133:org.apache.cxf.bundle:2.4.3.fuse-01-02]
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.retrieveEngine(JettyHTTPDestination.java:115)[133:org.apache.cxf.bundle:2.4.3.fuse-01-02]
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.finalizeConfig(JettyHTTPDestination.java:148)[133:org.apache.cxf.bundle:2.4.3.fuse-01-02]

Is there any other configuration/settings required? I want to setup HTTPS at
container level so that we do not need to switch between HTTP (QA
environment) and HTTPS (Production Environment)

I appreciate your help.

Thanks,



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-CXF-HTTPS-tp5721517.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to