Home > Article > Backend Development > Certificate error when obtaining user information after php curl logs in to QQ_PHP tutorial
This article mainly introduces the certificate error when php curl obtains user information after logging into qq. Friends who need it can refer to it.
The QQ login function of the ecmall mall was opened tonight. An error occurred during the callback. When the file_get_contents function was executed, the correct information was not captured, so curl was used instead, but a certificate error was prompted.
I found a solution online, which is to remove the certificate authentication.
The code is as follows:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
This method is feasible.
There is another way to say it online, which is to use
The code is as follows:
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
But the test results are wrong.
Very simple solution, but it took a lot of effort to search for information. I will record it here and share it with everyone.