With PHP & curl, I need to connect via a proxy to a SSL secured site, and, ignore certificate warnings. My curl command line looks like this:
curl -k -u username:password -X GET https://someURL
Looking through curl.php, I see what I think are the correct options to set. With them, I end up with something like this:
$ch = curl_init("https://someURL");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Ignore cert errors?
curl_setopt($ch, CURLOPT_PROXY, true); // Proxy true?
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
$result = curl_exec($ch);
But, $result always returns false. My password has a special character in it, "!". Perhaps I need to escape it? Other than that, any other ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…