付款网关HTTP错误:cURL错误:51:SSL:证书使用者名称“ seguro3.cpmp.com.gt”与目标主机名“ 190.0.195.24”不匹配

时间:2018-10-27 00:55:23

标签: ssl curl openssl nusoap

我正在尝试将支付网关连接到我的网站,但是我是一个初学者,他们向我发送了示例代码,并将其调整为我的网站,但是当我尝试付款时,出现此错误: “ wsdl错误:正在获取https://190.0.195.24:9001/paymentgw/services/paymentgw?wsdl-HTTP错误:cURL错误:51:SSL:证书使用者名称'seguro3.cpmp.com.gt'与目标主机名称'190.0.195.24'不匹配 网址:https://190.0.195.24:9001/paymentgw/services/paymentgw?wsdl” 这是我的代码:

require_once('./libsoap/nusoap.php');
        $url = "https://190.0.195.24:9001/paymentgw/services/paymentgw?wsdl";
        $client = new nusoap_client($url , 'wsdl' , false, false, false, false, 0, 25);
        $client->authtype = 'certificate'; 
        $client->certRequest['sslcertfile'] = '/var/www/vhosts/VisaKeys/iga.pem';
        $client->certRequest['sslkeyfile'] = '/var/www/vhosts/VisaKeys/iga.key';
        $client->certRequest['CACert'] = '/var/www/vhosts/VisaKeys/VisaNetCA.key'; 
        $client->certRequest['verifypeer']=0;
        $client->certRequest['passphrase']='pass';



        $err = $client->getError();
        if ($err) {
            // Display the error
            echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
            // At this point, you know the call that follows will fail
        }

        if($result == FALSE)
        {

            echo "<center>";
            $result = $client->call('authorizationRequest', $params);
            $timing = time() - $start; // calculating the transaction time 
            //echo "<pre>".print_r($result, false) . "</pre>";
            echo "<h5>Finish time: " . time() . " <br>";
            echo "<h5>Total time: " . print_r($timing, true) . "<br>";
            echo "Hubo un Error en su transaccion por favor intente nuevamente";
            echo "<center>";
        }
        if ($client->fault) 
        {
            echo '<h2>Fault</h2><pre>';
            print_r($result);
            echo '</pre>';
        } 
        else 
        {
            // Check for errors
            $err = $client->getError();
            if ($err)
            {
                // Display the error
                echo '<h2>Error</h2><pre>' . $err . '</pre>';
            } 

        }

1 个答案:

答案 0 :(得分:0)

SSL证书仅验证域名,而不验证IP地址。 您需要忽略证书错误,或将190.0.195.24替换为服务器具有有效证书的主机名。

seguro3.cpmp.com.gt是一个不错的猜测:-)

seguro3.cpmp.com.gt。 5379 IN A 190.0.195.24