duanjizi9443 2017-11-13 14:19
浏览 2115

卷曲错误:错误:14094418:SSL例程:ssl3_read_bytes:tlsv1 alert unknown ca

I'm working on a payment system integration for a website. For now I'm testing on a local computer with xampp. I have submitted a .csr file to the bank server, then they provide me the .crt file. I do have a .key file too.

When I try to submit the certificate and some value to the bank server with including certificate file path (.crt) and .key file, it throws the error:

Curl Error : error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca

My code is:

 $twpg_gateway_url = '<bankurl>';
    $twpg_cert_file = getcwd().'<.crtfile with path>'; 
    $twpg_key_file = getcwd().'<.keyfile with path>';
    $twpg_key_password = '';
    $curl = curl_init();

    $options = array(
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HEADER => false,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_SSL_VERIFYHOST => false,
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_POST => true,
        CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)',
        //CURLOPT_VERBOSE        => true,
        CURLOPT_URL => $twpg_gateway_url . '/Exec',
        CURLOPT_POSTFIELDS => $request,
        CURLOPT_HTTPHEADER => array('Content-Type: text/xml'),
        CURLOPT_TIMEOUT => 30
    );

    if ($twpg_cert_file != '') {
        $options[CURLOPT_SSLCERT] = $twpg_cert_file;
        $options[CURLOPT_SSLKEY] = $twpg_key_file;
        $options[CURLOPT_SSLKEYPASSWD] = $twpg_key_password;
    }

    curl_setopt_array($curl, $options);

    $response = curl_exec($curl);
    if(!$response)
    {
        echo "Curl Error : " . curl_error($curl);
    }
    curl_close($curl);

    return $response;
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c程序不知道为什么得不到结果
    • ¥40 复杂的限制性的商函数处理
    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置