SoFunction
Updated on 2025-03-05

Certificate error when obtaining user information after logging into qq

The QQ login function of the ecmall mall was opened tonight, and an error occurred during callback. When the file_get_contents function was executed, the correct information was not captured, so I used curl instead, but the certificate was wrong.

I found a solution online, which is to remove the certificate authentication.

Copy the codeThe 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 saying on the Internet, which is to use it

Copy the codeThe code is as follows:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

But the test results are wrong.

A very simple solution, but it took a lot of effort to check the information. I recorded it here and shared it with you.