have been docking an HTTPS interface for the last two days
After the perfect link with the local postman server has been error
Problem: Linux under Curl can be accessed normally but PHP requests always return FALSE
Test method: Var_dump (Curl_error ($ch)); < before close >
return: "ssl:certificate subject name ' xxx ' does not match target host name ' www.miniscores.cn '"
This indicates that the SSL certificate is problematic if the other party does not have a given certificate. Just ignore it.
Workaround:
1, ignore the certificate (two must add!) Otherwise, it cannot be ignored):
curl_setopt ($ch, Curlopt_ssl_verifypeer, false);
curl_setopt ($ch, Curlopt_ssl_verifyhost, false);
2, nature is to let each other provide certificates
Another solution to the problem of turning the great God (taoismess):
using Curl in the command line to invoke the method of skipping SSL certificate checking, the friend you need can refer to below. Symptom: Php Curl calls HTTPS error troubleshooting method: Try using Curl on the command line. Cause: The server's computer room cannot verify the SSL certificate. Workaround: Skip the SSL certificate check. curl_setopt ($ch, Curlopt_ssl_verifypeer, false); Symptom: Php Curl call Curl_exec returns BOOL (false), command line curl is called normally. Troubleshooting methods: Var_dump (Curl_error ($ch)); Returns: string (Reply) "Empty from server" and then troubleshoot: curl_setopt ($ch, Curlopt_header, true); curl_setopt ($ch, Curlopt_returntransfer, false); return: http/1.1 Continue connection:close Reason: Php Curl received HTTP 100 ended, should continue to receive HTTP 200 solution: curl_setopt ($ch, curlopt_httph Eader, Array (' Expect: '));
PHP Curl access to HTTPS domain interface has been an error problem