Home > php教程 > php手册 > 银企直连接口问题,php curl

银企直连接口问题,php curl

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:45:18
Original
2301 people have browsed it

用php curl 调用银行银企直连的接口,首先安装了一个 security Proxy(里面安装了证书:私钥pfx格式证书(私钥用来加密生成签名发送报文),公钥是cer格式证书(公钥用来验证返回报文里的签名) ) 银行的人说,安装了这代理软件,就不用自己构建证书什么的,

用php curl 调用银行银企直连的接口,首先安装了一个 security Proxy(里面安装了证书:私钥pfx格式证书(私钥用来加密生成签名发送报文),公钥是cer格式证书(公钥用来验证返回报文里的签名)

银行的人说,安装了这代理软件,就不用自己构建证书什么的,直接程序调用接口,

php 代码如下: 已经开启了curl 扩展

//构造xml
   $xmldata='**********';
   //初始一个curl会话
   $curl = curl_init();
   //设置发送方式: post
   curl_setopt($curl, CURLOPT_POST, true);
   //这是是否有返回值
   curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
   //设置url
   $url = '******************';
   curl_setopt($curl, CURLOPT_URL, $url);
   //设置发送数据
   curl_setopt($curl, CURLOPT_POSTFIELDS, $xmldata);
    //设置 超时时间
    curl_setopt($curl, CURLOPT_TIMEOUT, 200);
   //得到返回值
   $response = curl_exec($curl);
   //返回curl错误 
   var_dump(curl_error($curl));
   //关闭cURL资源,并且释放系统资源
   curl_close($curl);

可总是报这样的错误:"SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed"

求救

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template