You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by "Hussain, Syed" <Sy...@tfn.com> on 2002/08/29 16:32:44 UTC

Can some please take a look at this socket error

Hi everyone ,

I m trying to connect to a webservice using https:// , i installed jsse. I m
passing -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol
and -Djavax.net.debug=ssl to debug from args of my webserver. I get Error
opening socket and IllegalArgument exception. I have attached the debug
trace please let me know what i m missing.

I m running a Java client to connect to the same webservice from the same
client m/c it works fine . 

Also i did one more test conneting to a https:// server by writing a servlet
to connect to a https:// address , i get back a successful page . This shows
my https is fine . Guys any suggestions . Can some one take a look . 

Also I have attached my soap request envelope and system property setting
code.

Thanks
Syed

Code : -

try {
                         
                        System.setProperty("javax.net.ssl.keyStorePassword",
"resin_pw");
 
System.setProperty("javax.net.ssl.keyStore","/usr/local/resin/keys/private.k
eystore");
 
//System.setProperty("javax.net.ssl.trustStorePassword", "infonoxsoap");
                        // Next line not necessary
                        System.setProperty("javax.net.ssl.keyStoreType",
"jks");
                        Document resultDoc =
getWebServResponse(webServiceUrl);
                        XmlUtils.printDocument(resultDoc,System.out);
                         
                     }
                     catch(Exception e){
                         e.printStackTrace();
                         System.out.println("Exception in webservice part:"+
e);
                         Ldaplogin(req , res );
                     }



 protected Document  getWebServResponse(String url) throws
SAXException,IOException , SOAPException {
            
            Envelope msgEnv = null ;
            Message msg = new Message () ;
            StringBuffer strBuff = new StringBuffer("");
            strBuff.append("<?xml version='1.0' encoding='utf-8'?>");
            strBuff.append("<soap:Envelope
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">");
            strBuff.append("<soap:Body>");
            strBuff.append("<GetUserProductEnt
xmlns=\"urn:get-user-product-ent\">");
            strBuff.append("<GuardianRequest username=\"crm\"
password=\"crm\" interfaceCode=\"CRM\">");
            strBuff.append("<user userName=\"sop01\" password=\"mmmx\">");
            strBuff.append("<Delivery deliveryCode=\"AEN\"/>");
            strBuff.append("</user>");
	    	strBuff.append("</GuardianRequest>");
            strBuff.append("</GetUserProductEnt>");
            strBuff.append("</soap:Body>");
            strBuff.append("</soap:Envelope>");
            System.out.println(strBuff.toString());
            Reader r = new StringReader(strBuff.toString());
            DocumentBuilder xdb = XMLParserUtils.getXMLDocBuilder();
            Document doc = xdb.parse (new InputSource (r));
            msgEnv = Envelope.unmarshall (doc.getDocumentElement ());
            msg.send (new URL (url), "urn:get-user-product-ent" , msgEnv);
            //msg.send (new URL (url), "urn:this-is-the-action-uri" ,
msgEnv);
            //"urn:this-is-the-action-uri"
            SOAPTransport st = msg.getSOAPTransport ();
            doc = xdb.parse(new InputSource(st.receive()));
            
            return doc;
            
        }


<?xml version='1.0' encoding='utf-8'?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GetUserPr
oductEnt xmlns="urn:get-user-product-ent"><GuardianRequest username="crm"
password="crm" interfaceCode="CRM"><user userName="sop01"
password="mmmx"><Delivery
deliveryCode="AEN"/></user></GuardianRequest></GetUserProductEnt></soap:Body
></soap:Envelope>
keyStore is : 
keyStore type is : jks
init keystore
init keymanager of type SunX509
trustStore is: /usr/jdk1.3.1_01/jre/lib/security/cacerts
trustStore type is : jks
init truststore
adding as trusted cert: [
[
  Version: V3
  Subject: EmailAddress=personal-freemail@thawte.com, CN=Thawte Personal
Freemail CA, OU=Certification Services Division, O=Thawte Consulting, L=Cape
Town, ST=Western Cape, C=ZA
  Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4

  Key:  com.sun.net.ssl.internal.ssl.JSA_RSAPublicKey@228362
  Validity: [From: Sun Dec 31 19:00:00 EST 1995,
               To: Thu Dec 31 18:59:59 EST 2020]
  Issuer: EmailAddress=personal-freemail@thawte.com, CN=Thawte Personal
Freemail CA, OU=Certification Services Division, O=Thawte Consulting, L=Cape
Town, ST=Western Cape, C=ZA
  SerialNumber: [  0  ]

Certificate Extensions: 1
[1]: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
CA:true
PathLen:2147483647
]

-- a lot of Algorithm trace and the last exception line is ----

trigger seeding of SecureRandom
done seeding SecureRandom

Exception in webservice part:[SOAPException: faultCode=SOAP-ENV:Client;
msg=Error opening socket: null;
targetException=java.lang.IllegalArgumentException: Error opening socket:
null]