IPG Payment Gateway.javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:找不到可信证书

时间:2016-07-04 04:38:02

标签: java security ssl payment-gateway

我目前正在使用IPG(互联网支付网关)集成。为此,他们提供了演示证书(* .pfx)来测试连接。但是在运行测试代码时,我遇到了错误。

ResponseDescription是处理请求错误:javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:找不到可信证书

代码: - (属性文件存在)

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;
}

任何人请协助此事。

1 个答案:

答案 0 :(得分:0)

我通过放置正确的证书解决了这个问题。代码没有问题。