Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSL Error

Status
Not open for further replies.

DaWickedRebel

Programmer
Dec 3, 2004
33
US
Hi all

Rather new to using SSL though not so much to Java itself.

I am attempting to connect to an outside vendor's Web Service via SSL and am getting the error "javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake"

Here are some snippets of my code:

Code:
public class ClientTEST extends TestCase {

    public void testCall() {
        try {
            NewOrderResponseElement authResponse = null;
            PaymentechGatewayLocator service = new PaymentechGatewayLocator();            //Next create a port from the service
            PaymentechGatewayPortType portType = service.getPaymentechGateway(new URL("[URL unfurl="true"]https://theRealAddress/Gateway"));[/URL]

            NewOrderRequestElement authBean = new NewOrderRequestElement();
            authBean.setTransType("A");
            authBean.setBin("000001");
            authBean.setMerchantID("300003111111");
            authBean.setTerminalID("001");
            authBean.setAmount("1000");
            authBean.setCcCardVerifyNum("2233");
            authBean.setCcAccountNum("4055011111111111");
            authBean.setComments("Test Web Service Auth Only Transaction");
            authBean.setOrderID("testOrder101");
            authBean.setIndustryType("EC");
            //Invoke the newOrder service and get the response bean
            authResponse = portType.newOrder(authBean);
            //Print response Codes from the response bean
            System.out.println("######### Response Received ##############");
            System.out.println(" ProcStatus: " + authResponse.getProcStatus());
            System.out.println(" ProcStatusMessage: " + authResponse.getProcStatusMessage());
            System.out.println(" RespCode: " + authResponse.getRespCode());
            System.out.println(" ApprovalStatus: " + authResponse.getApprovalStatus());
            System.out.println(" AuthorizationCode: " + authResponse.getAuthorizationCode());
        } catch (AxisFault ie) {
            System.out.println("Fault Response: \n" + ie);
            fail(ie.getMessage());
            return;
        } catch (Exception ie) {
            System.out.println("Error Response: \n" + ie);
            fail(ie.getMessage());
            return;
        }
    }
}

and the call code:

Code:
    public NewOrderResponseElement newOrder(NewOrderRequestElement newOrderRequest) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call call = createCall();
        call.setOperation(_operations[0]);
        call.setEncodingStyle(null);
        call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        call.setOperationName(new javax.xml.namespace.QName("theRealAddress/Gateway", "NewOrder"));

        setRequestHeaders(call);
        setAttachments(call);
 try {        Object resp = call.invoke(new java.lang.Object[] {newOrderRequest});  <-------throws HandShakeException

        if (resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)resp;
        }
        else {
            extractAttachments(call);
            try {
                return (NewOrderResponseElement) resp;
            } catch (Exception _exception) {
                return (NewOrderResponseElement) org.apache.axis.utils.JavaUtils.convert(resp, NewOrderResponseElement.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }


My associate runs the exact same code on his machine and gets the expected result, but I get this error. Google has been less then helpful trying to track down a cause of this problem.

Has anyone ever dealt with this issue before, and if so could you point an SSL newbie in the right direction?

Thanks for any help.
 
Are you sure it is a problem with your programming and not a security problem with the processor? Maybe the processor doesn't recognize your software and terminates the connection because of that. Your error message leads me to think you made the connection, but was turned down.
Sorry, but I can not help with the java programming part, as I have had only a couple of intro classes to it, but I do work with the front end of credit card softwares like pcCharge and I would guess these softwares have some sort of flag that lets them through.
Could be wrong, just my 1 cent in case no one else post back.

Bo

Kentucky phone support-
"Mash the Kentrol key and hit scape."
 
I've made use of the Apache Commons HttpClient library with success. Makes everything sooo much easier.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top