curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE)..."."/> curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE)...".">

Home  >  Article  >  Backend Development  >  How to set up php curl ssl without opening it

How to set up php curl ssl without opening it

藏色散人
藏色散人Original
2021-07-27 09:29:221979browse

php How to disable SSL in curl: First open the corresponding PHP file; then cancel SSL verification through "curl_setopt($this->curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE)...".

How to set up php curl ssl without opening it

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

How to set up php curl ssl without opening it?

php curl function does not require SSL verification

//这两行取消ssl验证,否则会校验证书。。。 这两个缺一不可
curl_setopt($this->curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($this->curl_handle, CURLOPT_SSL_VERIFYHOST, FALSE);

Related introduction:

curl_setopt - Set cURL transmission options

Instructions

curl_setopt(resource $ch, int $option, mixed $value): bool

is cURL session handle settings options.

Parameters

handle

The cURL handle returned by curl_init().

option

CURLOPT_XXX options that need to be set.

value

The value that will be set on the option option.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to set up php curl ssl without opening it. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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