Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3AA39B74 for ; Fri, 24 Feb 2012 09:52:14 +0000 (UTC) Received: (qmail 6066 invoked by uid 500); 24 Feb 2012 09:52:14 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 6028 invoked by uid 500); 24 Feb 2012 09:52:14 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 6015 invoked by uid 99); 24 Feb 2012 09:52:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 09:52:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 09:52:10 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id ED992338BE5 for ; Fri, 24 Feb 2012 09:51:48 +0000 (UTC) Date: Fri, 24 Feb 2012 09:51:48 +0000 (UTC) From: "Brijpal (Commented) (JIRA)" To: issues@cxf.apache.org Message-ID: <292566193.14784.1330077108974.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CXF-2403) Use of client certificates via http conduit configuration broken MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-2403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13215533#comment-13215533 ] Brijpal commented on CXF-2403: ------------------------------ This is in reference to sample demo soap_https.zip Thank you very much for such wonderful explanation. It's really good demo and tried it, it's working when if I use both server and client part of it. I am impressed and decided to use it's client part to access web service running on my local machine. The web service is provided by some third party to generate random string. I can put my public certificate in it's trust store and I know it's public certificates too. I followed these steps 1. I put server's certificate in client-truststore 2. I extracted client certificate from "client-keystore" and put it in server's trust store 3. Put my WSDL ("GenerateRandom.wsdl") parallel to "HelloWorld.wsdl" 4. Wrote RandomClient.java in parallel to Client.java (which uses cxfContext.xml placed parallel to hello_world_client.xml) 5. Modified build.xml to generate code and run the client. When I tried to run using ant I am getting following exception. [java] org.apache.cxf.interceptor.Fault: Could not send Message. [java] at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) [java] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243) [java] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487) [java] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [java] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [java] at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [java] at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [java] at $Proxy38.oprRandomRequest(Unknown Source) [java] at demo.soaphttps.client.RandomClient.main(UTNClient.java:37) [java] Caused by: org.apache.cxf.transport.http.UntrustedURLConnectionIOException: UntrustedURLConnectionIOException invoking https://localhost:9091/XYZ.Common/WcfService_XYZ_Common_Orchestrations.svc: RequireClientCertificate is set, but no local certificates were negotiated. Is the server set to ask for client authorization? [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [java] at java.lang.reflect.Constructor.newInstance(Unknown Source) [java] at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:2058) [java] at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2043) [java] at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) [java] at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639) [java] at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) I tried to google but cound not find any help. Please help me how to get rid of this. I am using apache cxf 2.2.9 Service WSDL is service "*" port "*" operation "OprRandomRequest" operation "OprRandomRequest" https://localhost:9091/XYZ.Common/WcfService_XYZ_Common_Orchestrations.svc Spring configuration is .* .*_DH_anon_.* > Use of client certificates via http conduit configuration broken > ---------------------------------------------------------------- > > Key: CXF-2403 > URL: https://issues.apache.org/jira/browse/CXF-2403 > Project: CXF > Issue Type: Bug > Components: Configuration > Reporter: Wolfgang Nagele > Attachments: client-keystore, client-truststore, client.crt, client.key, client.p12, server-keystore, server-truststore, server.crt, server.key, server.p12, soap_https.zip > > > To use standard SSL client certificates for authentication the following configuration should work: > > > > > > > > > > > In this configuration we would have the public certificate of the server we want to connect to in the truststore and the private key and certificate in the keystore. > With the current CXF implementation this results in the following exception: > sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target > at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:174) [na:1.6.0_13] > at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) [na:1.6.0_13] > at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:280) [na:1.6.0_13] > ... 39 common frames omitted > Once we additionally define the following properties it works: > * javax.net.ssl.keyStore=keystore > * javax.net.ssl.keyStorePassword=password > * javax.net.ssl.trustStore=truststore > * javax.net.ssl.trustStorePassword=password > This however results in very ugly setups where we have to define the same data twice. Also we miss out on CXF's option of defining specific keystores and truststores per webservice. > For further information also see: http://www.quendor.org/archiv/428 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira