Home > Backend Development > PHP Tutorial > curl 选项的问题

curl 选项的问题

WBOY
Release: 2016-06-06 20:22:32
Original
1452 people have browsed it

CURLOPT_SSL_VERIFYPEER php curl中这个参数是什么意思,是验证证书还是不验证证书?

回复内容:

CURLOPT_SSL_VERIFYPEER php curl中这个参数是什么意思,是验证证书还是不验证证书?

<code>curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// 第三个参数为`false`表示信任任何证书,curl https站点时没有证书需设置</code>
Copy after login

这里你可以看下PHP官方文档的解释:

http://php.net/manual/zh/function.curl-setopt.php

禁用后cURL将终止从服务端进行验证。使用CURLOPT_CAINFO选项设置证书使用CURLOPT_CAPATH选项设置证书目录 如果CURLOPT_SSL_VERIFYPEER(默认值为2)被启用,CURLOPT_SSL_VERIFYHOST需要被设置成TRUE否则设置为FALSE。

Related labels:
php
source:php.cn
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template