You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "peter.berkman" <pe...@cornergrove.com> on 2012/11/09 17:47:31 UTC

Configuring HTTPS for CXF

I am still struggling with this HTTP vs HTTPS issue.  The exception I get is:
    org.apache.camel.RuntimeCamelException: java.lang.RuntimeException:
Protocol mismatch for port 9002: engine's protocol is http, the url protocol
is https

I'm running the latest version of Camel and CXF on Glassfish 3.1.2.

Here is how I have it configured - does anyone see anything obvious?:

{code}
	<http:destination
name="{urn:ihe:iti:pdqv3:2007}pdqSupplierPort.http-destination">
	</http:destination>
	
	<httpj:engine-factory bus="cxf">
	
		<httpj:engine port="${nextgate.ms.hl7v3.pdq.listenport}">
		
			<httpj:tlsServerParameters>
			
				<sec:keyManagers keyPassword="${nextgate.ms.sec.privatekey.password}">
					<sec:keyStore type="JKS"
password="${nextgate.ms.sec.keystore.password}"
file="${nextgate.ms.sec.keystore.file}" />
				</sec:keyManagers>
				
				<sec:trustManagers>
					<sec:keyStore type="JKS"
password="${nextgate.ms.sec.truststore.password}"
file="${nextgate.ms.sec.truststore.file}" />
				</sec:trustManagers>
				
				<sec:cipherSuitesFilter>
					<sec:include>.*_EXPORT_.*</sec:include>
					<sec:include>.*_EXPORT1024_.*</sec:include>
					<sec:include>.*_WITH_DES_.*</sec:include>
					<sec:include>.*_WITH_NULL_.*</sec:include>
					<sec:exclude>.*_DH_anon_.*</sec:exclude>
				</sec:cipherSuitesFilter>
				
				<sec:clientAuthentication want="false" required="false" />
				
			</httpj:tlsServerParameters>
			
			<httpj:sessionSupport>true</httpj:sessionSupport>
		</httpj:engine>
	</httpj:engine-factory>

	<cxf:cxfEndpoint	id="pdqSupplierEndpoint"   
					
address="https://${nextgate.ms.hl7v3.pdq.listenaddr}:${nextgate.ms.hl7v3.pdq.listenport}/services/PDQSupplier"
						endpointName="ssp:pdqSupplierPort"
						serviceName="ssp:pdqSupplierService"
						serviceClass="ihe.iti.pdqv3._2007.PDQSupplierPortType"
						xmlns:ssp="{urn:ihe:iti:pdqv3:2007}">
		
		<cxf:binding>
			<soap:soapBinding mtomEnabled="true" version="1.2" />
		</cxf:binding>

	</cxf:cxfEndpoint>

{code}



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

Re: Configuring HTTPS for CXF

Posted by Christian Müller <ch...@gmail.com>.
Thanks for sharing your solution with the community! Enjoy your further
Camel ride.

Best,
Christian

Sent from a mobile device
Am 10.11.2012 08:50 schrieb "peter.berkman" <pe...@cornergrove.com>:

> got it working !!!  I did remove the http:destination lines, but I think
> the
> real issue was that I had upgraded to the latest version of Spring.  The
> war
> file had some straggler old Spring jars.  So, excluded from main
> dependancies and included the "right" version in the war pom...  all is
> GOOD!
>
> Thank you for all of your support!!!
>
> In case someone else is planning to upgrade Spring, here are the specific
> excludes I made in the dependencyMangment for packages that broght in the
> older version:
>
> {code}
>                         <dependency>
>                                 <groupId>org.apache.camel</groupId>
>                                 <artifactId>camel-jms</artifactId>
>                                 <version>${camel-version}</version>
>                                 <exclusions>
>                                         <exclusion>
>
> <groupId>org.springframework</groupId>
>
> <artifactId>spring-jms</artifactId>
>                                         </exclusion>
>                                         <exclusion>
>
> <groupId>org.springframework</groupId>
>
> <artifactId>spring-tx</artifactId>
>                                         </exclusion>
>                                 </exclusions>
>                         </dependency>
>
>                         <dependency>
>                                 <groupId>org.apache.camel</groupId>
>                                 <artifactId>camel-cxf</artifactId>
>                                 <version>${camel-version}</version>
>                                 <exclusions>
>                                         <exclusion>
>
> <groupId>org.apache.cxf</groupId>
>
> <artifactId>cxf-rt-frontend-jaxrs</artifactId>
>                                         </exclusion>
>                                         <exclusion>
>
> <groupId>org.apache.cxf</groupId>
>
> <artifactId>cxf-rt-bindings-soap</artifactId>
>                                         </exclusion>
>                                 </exclusions>
>                         </dependency>
>
>                         <dependency>
>                                 <groupId>org.apache.camel</groupId>
>                                 <artifactId>camel-spring</artifactId>
>                                 <version>${camel-version}</version>
>                                 <exclusions>
>                                         <exclusion>
>
> <groupId>org.springframework</groupId>
>
> <artifactId>spring-aop</artifactId>
>                                         </exclusion>
>                                 </exclusions>
>                         </dependency>
>
>
>
> {code}
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Configuring-HTTPS-for-CXF-tp5722427p5722445.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Configuring HTTPS for CXF

Posted by "peter.berkman" <pe...@cornergrove.com>.
got it working !!!  I did remove the http:destination lines, but I think the
real issue was that I had upgraded to the latest version of Spring.  The war
file had some straggler old Spring jars.  So, excluded from main
dependancies and included the "right" version in the war pom...  all is
GOOD!

Thank you for all of your support!!!

In case someone else is planning to upgrade Spring, here are the specific
excludes I made in the dependencyMangment for packages that broght in the
older version:

{code}
			<dependency>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-jms</artifactId>
				<version>${camel-version}</version>
				<exclusions>
					<exclusion>
						<groupId>org.springframework</groupId>
						<artifactId>spring-jms</artifactId>
					</exclusion>
					<exclusion>
						<groupId>org.springframework</groupId>
						<artifactId>spring-tx</artifactId>
					</exclusion>
				</exclusions>
			</dependency>

			<dependency>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-cxf</artifactId>
				<version>${camel-version}</version>
				<exclusions>
					<exclusion>
						<groupId>org.apache.cxf</groupId>
						<artifactId>cxf-rt-frontend-jaxrs</artifactId>
					</exclusion>
					<exclusion>
						<groupId>org.apache.cxf</groupId>
						<artifactId>cxf-rt-bindings-soap</artifactId>
					</exclusion>
				</exclusions>
			</dependency>

			<dependency>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-spring</artifactId>
				<version>${camel-version}</version>
				<exclusions>
					<exclusion>
						<groupId>org.springframework</groupId>
						<artifactId>spring-aop</artifactId>
					</exclusion>
				</exclusions>
			</dependency>



{code}




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

Re: Configuring HTTPS for CXF

Posted by Christian Müller <ch...@gmail.com>.
Can you test it without the "http:destination" configuration?
It works for us without it.

Best,
Christian

On Fri, Nov 9, 2012 at 5:47 PM, peter.berkman <peter.berkman@cornergrove.com
> wrote:

> I am still struggling with this HTTP vs HTTPS issue.  The exception I get
> is:
>     org.apache.camel.RuntimeCamelException: java.lang.RuntimeException:
> Protocol mismatch for port 9002: engine's protocol is http, the url
> protocol
> is https
>
> I'm running the latest version of Camel and CXF on Glassfish 3.1.2.
>
> Here is how I have it configured - does anyone see anything obvious?:
>
> {code}
>         <http:destination
> name="{urn:ihe:iti:pdqv3:2007}pdqSupplierPort.http-destination">
>         </http:destination>
>
>         <httpj:engine-factory bus="cxf">
>
>                 <httpj:engine port="${nextgate.ms.hl7v3.pdq.listenport}">
>
>                         <httpj:tlsServerParameters>
>
>                                 <sec:keyManagers
> keyPassword="${nextgate.ms.sec.privatekey.password}">
>                                         <sec:keyStore type="JKS"
> password="${nextgate.ms.sec.keystore.password}"
> file="${nextgate.ms.sec.keystore.file}" />
>                                 </sec:keyManagers>
>
>                                 <sec:trustManagers>
>                                         <sec:keyStore type="JKS"
> password="${nextgate.ms.sec.truststore.password}"
> file="${nextgate.ms.sec.truststore.file}" />
>                                 </sec:trustManagers>
>
>                                 <sec:cipherSuitesFilter>
>
> <sec:include>.*_EXPORT_.*</sec:include>
>
> <sec:include>.*_EXPORT1024_.*</sec:include>
>
> <sec:include>.*_WITH_DES_.*</sec:include>
>
> <sec:include>.*_WITH_NULL_.*</sec:include>
>
> <sec:exclude>.*_DH_anon_.*</sec:exclude>
>                                 </sec:cipherSuitesFilter>
>
>                                 <sec:clientAuthentication want="false"
> required="false" />
>
>                         </httpj:tlsServerParameters>
>
>                         <httpj:sessionSupport>true</httpj:sessionSupport>
>                 </httpj:engine>
>         </httpj:engine-factory>
>
>         <cxf:cxfEndpoint        id="pdqSupplierEndpoint"
>
> address="https://
> ${nextgate.ms.hl7v3.pdq.listenaddr}:${nextgate.ms.hl7v3.pdq.listenport}/services/PDQSupplier"
>
> endpointName="ssp:pdqSupplierPort"
>
> serviceName="ssp:pdqSupplierService"
>
> serviceClass="ihe.iti.pdqv3._2007.PDQSupplierPortType"
>
> xmlns:ssp="{urn:ihe:iti:pdqv3:2007}">
>
>                 <cxf:binding>
>                         <soap:soapBinding mtomEnabled="true" version="1.2"
> />
>                 </cxf:binding>
>
>         </cxf:cxfEndpoint>
>
> {code}
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Configuring-HTTPS-for-CXF-tp5722427.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--