php curl https ssl 证书问题

CURL代码:

$curl = curl_init();

curl_setopt($curl,CURLOPT_URL,$url);

curl_setopt($curl, CURLOPT_PORT, 443);

curl_setopt($curl, CURLOPT_SSLVERSION, 3);

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //信任任何证书

curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 检查证书中是否设置域名,0不验证

curl_setopt($curl, CURLOPT_VERBOSE, 1); //debug模式

curl_setopt($curl, CURLOPT_SSLCERT, "./keys/client.crt"); //client.crt文件路径

curl_setopt($curl, CURLOPT_SSLCERTPASSWD, "112358"); //client证书密码

curl_setopt($curl, CURLOPT_SSLKEY, "./keys/client.key");

curl_setopt($curl, CURLOPT_POST, 1);

curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

你可能感兴趣的:(php curl https ssl 证书问题)