简体   繁体   中英

IPG Payment Gateway.javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

I am currently working with an IPG(Internet Payment gateway) integration. For that, they provided a Demo Certificate (*.pfx) to test connection. But while running the test code I am getting below error.

ResponseDescription is Processing request error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

Code : - (property file is present there)

String propFile = null;
if (aArgs.length == 0) {
    propFile =  new String("d://Development/SPI/Properties/"
            + "SPI.properties");
            System.out.println(propFile);
} else 
    propFile = aArgs[0];
try {
    Transaction transaction = new Transaction(propFile);
    transaction.initialize("Registration","1.0");
    transaction.setProperty("Customer", "Demo Merchant");
    transaction.setProperty("Amount", "1213.23");
    transaction.setProperty("OrderName", "Test");
    transaction.setProperty("OrderInfo", "Test - Long description");
    transaction.setProperty("Currency","AED");
    transaction.setProperty("OrderID","TEST{Y}{m}{d}{Od3}");
    transaction.setProperty("TransactionHint", "CPT:N");
    //transaction.setProperty("ExtraData/Account", "Something here");
    //transaction.setProperty("ExtraData/BillingPeriod", "2004/12");
    transaction.setProperty("ReturnPath", "http://localhost:8080/demo_merchant3d/finalize.jsp");

    transaction.execute();
    System.out.println("ResponseCode is "+transaction.getResponseCode());
    System.out.println("ResponseDescription is "+transaction.getResponseDescription());
    if (transaction.getResponseCode() == 0) {
                System.out.println("TransactionID "+
                    transaction.getProperty("TransactionID"));

    }
} catch (Exception e) {
    System.out.println(e.toString());   
    return;
}

any one please assist on this.

I resolved this by placing the correct certificate. There is no issue with the code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM