You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Ashish Mandloi (JIRA)" <ji...@apache.org> on 2017/09/25 09:46:00 UTC

[jira] [Created] (AXIS2-5892) Mutliple Client cert is not working with axis2 client

Ashish Mandloi created AXIS2-5892:
-------------------------------------

             Summary: Mutliple Client cert is not working with axis2 client 
                 Key: AXIS2-5892
                 URL: https://issues.apache.org/jira/browse/AXIS2-5892
             Project: Axis2
          Issue Type: Bug
          Components: client-api
            Reporter: Ashish Mandloi


Hi 

We have client which connecting to soap server and they have provided us client certificate which we have to installed in our keystore.  It was working fine until we have other client certificate from server. We have installed it in keystore and first call to webservie is working fine but for the second call we are getting the below Exception 

{code:java}

org.apache.axis2.AxisFault: unknown
        at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:517)
        at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
        at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
        at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
        at com.auruspay.manager.issuer.participants.processor.credibanco.VPOSWS20SOAPStub.authorize(VPOSWS20SOAPStub.java:193)
        at com.auruspay.manager.issuer.participants.processor.credibanco.CredibancoCartridge.connect(CredibancoCartridge.java:109)
        at com.auruspay.manager.issuer.participants.processor.credibanco.PauseCredibancoProcessor.run(CredibancoParticipant.java:92)
        at java.lang.Thread.run(Thread.java:745)

{code}


*Here is my code *

{code:java}

ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("/home/amandloi/Development/Kushki/Colombia/updated plugin/credibanco-plugin-api-java-2.1.0/resources/", null);

			VPOSWS20SOAPStub  serviceVPOSWS = new VPOSWS20SOAPStub(ctx, urlService);

			ServiceClient client = serviceVPOSWS._getServiceClient();
			client.engageModule("rampart");
			Options clientOptions = new Options();
			clientOptions.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, getOutflowConfiguration()); 
			clientOptions.setProperty(WSSHandlerConstants.INFLOW_SECURITY, getInflowConfiguration());
			//clientOptions.setUserName("client cert");
			//clientOptions.setPassword("k12345");
			clientOptions.setTo(new EndpointReference(urlService));
			//clientOptions.setTimeOutInMilliSeconds(1000);
			clientOptions.setProperty(HTTPConstants.SO_TIMEOUT, 10000);
			clientOptions.setProperty(HTTPConstants.CONNECTION_TIMEOUT, 10000);
			clientOptions.setManageSession(false);
			
			client.setOptions(clientOptions);
			client.setCachingOperationContext(false);
			System.out.println("URL :"+client.getOptions().getTo().getAddress());
			serviceVPOSWS._setServiceClient( client );
			
			/*serviceVPOSWS._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, new Integer("10000"));
       		serviceVPOSWS._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer("10000"));*/
			//VPOSWS20SOAPStub vposws20soapStub = new VPOSWS20SOAPStub("https://testecommerce.credibanco.com/vpos2/services/VPOSWS20SOAP?wsdl");
			time1 = System.currentTimeMillis();
			System.out.println(new Date());
			reqResp = serviceVPOSWS.authorize(req);


 private  Parameter getOutflowConfiguration() { 
        OutflowConfiguration ofc = new OutflowConfiguration(); 
        ofc.setActionItems("Signature Encrypt Timestamp"); 
        String fileName= "COMKEYCONFIG_"+clientID+".properties";
        LOG.info(participant.getTxnLogKey() + " PROPERTIES FILE NAME:"+fileName);
        ofc.setSignaturePropFile(fileName);
        
        //ofc.setSignatureKeyIdentifier("X509KeyIdentifier");
        ofc.setSignatureKeyIdentifier("DirectReference") ;
        ofc.setUser("client cert"); 
        ofc.setPasswordCallbackClass("com.auruspay.manager.issuer.participants.processor.credibanco.ClientPWCBHandler");
        ofc.setEncryptionPropFile(fileName); 
        ofc.setEncryptionUser("vposwscrypto");
        ofc.setEncryptionKeyIdentifier("X509KeyIdentifier"); 
        LOG.info("ofc.getProperty() OUTPUTFLOW : "+ofc.getProperty().toString());
        return ofc.getProperty(); 
    } 

    private  Parameter getInflowConfiguration() { 
        InflowConfiguration ifc = new InflowConfiguration();

        ifc.setActionItems("Signature Timestamp"); 
        String fileName= "COMKEYCONFIG_"+clientID+".properties";
        ifc.setSignaturePropFile(fileName);
        ifc.setPasswordCallbackClass("com.auruspay.manager.issuer.participants.processor.credibanco.ClientPWCBHandler"); 

        LOG.info("ifc.getProperty() INPUTFLOW : "+ifc.getProperty().toString());
        return ifc.getProperty(); 
    }

{code}


*Configuration for properties file *

org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=PKCS12
org.apache.ws.security.crypto.merlin.keystore.password=k12345
org.apache.ws.security.crypto.merlin.file=/home/test/Downloads/COM.p12






--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org