WSDLException thrown for NO Subject alternative DNS name matching when the 
server names do actually match
---------------------------------------------------------------------------------------------------------

                 Key: CXF-2354
                 URL: https://issues.apache.org/jira/browse/CXF-2354
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.2.2
         Environment: Ubuntu 8.10 32bit OS, Java 1.6.10, CXF 2.2.2, Ant 1.7.1
            Reporter: Conor Buescher


I am working on building a java based web services client for an already 
deployed .Net based web service built using WCF.  I am unable to run wsdl2java 
on the remote wsdl and have downloaded all of the associated wsdl files to my 
machine and I can then run wsdl2java using the following ant build.xml file:

<?xml version="1.0"?> 
<project name="cxf wsdl2java" default="cxfWSDL2Java" basedir=".">    
   <property name="cxf.home" location 
="/home/conorb/devTools/apache-cxf-2.2.2"/> 
 
   <path id="cxf.classpath"> 
      <fileset dir="${cxf.home}/lib"> 
         <include name="*.jar"/> 
         <include name="*.xml"/>
      </fileset> 
   </path> 
       
   <target name="cxfWSDL2Java"> 
      <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true"> 
        <arg value="-ant"/> 
        <arg value="-client"/>
        <arg value="-verbose"/> 
        <arg value="-sn"/>  
        <arg value="CustomerService"/> 
        <arg value="-d"/> 
        <arg value="ispe-client"/> 
        <arg value="/home/conorb/Documents/groovy/CustomerService.wsdl"/> 
        <classpath> 
                <path refid="cxf.classpath"/> 
        </classpath> 
      </java> 
   </target> 
</project>

Once that works I can edit the created files to point to the wsdl url, the 
external url is here: 
https://g4w0209.americas.hpqcorp.net/HPISWeb/ISASCustomerWebService/CustomerService.svc?wsdl
 - and then make changes to the client class for testing the service.

Additionally I download the SSL certificate into my java keystore using the 
following command: sudo keytool -import -trustcacerts -keystore  
/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/security/cacerts -storepass changeit 
-alias g4w0217 -file /home/conorb/Documents/groovy/g4w0217.cert.pem 

When I run ant ICustomerServiceClient on my modified java code I receive the 
following error:

con...@conorb-desktop:~/Documents/groovy/ispe-client$ ant ICustomerServiceClient
Buildfile: build.xml

compile:

ICustomerServiceClient:
     [java] Exception in thread "main" javax.xml.ws.WebServiceException: 
org.apache.cxf.service.factory.ServiceConstructionException: Failed to create 
service.
     [java]     at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149)
     [java]     at 
org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:65)
     [java]     at javax.xml.ws.Service.<init>(Service.java:56)
     [java]     at org.tempuri.CustomerService.<init>(CustomerService.java:49)
     [java]     at 
com.hp.hpis.customerservice._2009._02.ICustomerService_BasicHttpBindingICustomerService_Client.main(ICustomerService_BasicHttpBindingICustomerService_Client.java:55)
     [java] Caused by: 
org.apache.cxf.service.factory.ServiceConstructionException: Failed to create 
service.
     [java]     at 
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93)
     [java]     at 
org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:204)
     [java]     at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
     [java]     ... 4 more
     [java] Caused by: javax.wsdl.WSDLException: WSDLException (at 
/wsdl:definitions/wsdl:import): faultCode=PARSER_ERROR: Problem parsing 
'https://g4w0203.americas.hpqcorp.net/HPISWeb/ISASCustomerWebService/CustomerService.svc?wsdl=wsdl0'.:
 javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: 
No subject alternative DNS name matching g4w0203.americas.hpqcorp.net found.
     [java]     at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
     [java]     at com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(Unknown Source)
     [java]     at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown 
Source)
     [java]     at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
     [java]     at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
     [java]     at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
     [java]     at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
     [java]     at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
     [java]     at 
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:210)
     [java]     at 
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:175)
     [java]     at 
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
     [java]     ... 6 more
     [java] Caused by: javax.net.ssl.SSLHandshakeException: 
java.security.cert.CertificateException: No subject alternative DNS name 
matching g4w0203.americas.hpqcorp.net found.
     [java]     at 
com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
     [java]     at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
     [java]     at 
com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
     [java]     at 
com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
     [java]     at 
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1035)
     [java]     at 
com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:124)
     [java]     at 
com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
     [java]     at 
com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
     [java]     at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
     [java]     at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
     [java]     at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
     [java]     at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
     [java]     at 
sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:415)
     [java]     at 
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
     [java]     at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1026)
     [java]     at 
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
     [java]     at 
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
     [java]     at 
com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
     [java]     at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
     [java]     at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
     [java]     at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
     [java]     at 
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
     [java]     at 
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
     [java]     ... 17 more
     [java] Caused by: java.security.cert.CertificateException: No subject 
alternative DNS name matching g4w0203.americas.hpqcorp.net found.
     [java]     at 
sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:193)
     [java]     at 
sun.security.util.HostnameChecker.match(HostnameChecker.java:77)
     [java]     at 
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:264)
     [java]     at 
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:250)
     [java]     at 
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1014)
     [java]     ... 35 more
     [java] Java Result: 1

BUILD SUCCESSFUL
Total time: 4 seconds
con...@conorb-desktop:~/Documents/groovy/ispe-client$ 

Thanks,

conorb


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

Reply via email to