TLS 1.2 not working in cURL

You must use an integer value for the CURLOPT_SSLVERSION value, not a string as listed above Try this: curl_setopt ($setuploginurl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); // constant NOT string value http://php.net/manual/en/function.curl-setopt.php value should be an integer for the following values of the option parameter: CURLOPT_SSLVERSION One of: CURL_SSLVERSION_DEFAULT (0) CURL_SSLVERSION_TLSv1 (1) CURL_SSLVERSION_SSLv2 (2) CURL_SSLVERSION_SSLv3 (3) CURL_SSLVERSION_TLSv1_0 (4) CURL_SSLVERSION_TLSv1_1 … Read more

A problem occurred somewhere in the SSL/TLS handshake

Curl doesn’t have built-in root certificates (like most modern browser do). You need to explicitly point it to a cacert.pem file: curl_setopt($ch, CURLOPT_CAINFO, ‘/path/to/cert/file/cacert.pem’); Without this, curl cannot verify the certificate sent back via ssl. This same root certificate file can be used every time you use SSL in curl. You can get the cacert.pem … Read more

How to use CURL via a proxy?

Here is a working version with your bugs removed. $url=”http://dynupdate.no-ip.com/ip.php”; $proxy = ‘127.0.0.1:8888’; //$proxyauth=”user:password”; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_PROXY, $proxy); //curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); $curl_scraped_page = curl_exec($ch); curl_close($ch); echo $curl_scraped_page; I have added CURLOPT_PROXYUSERPWD in case any of your proxies require a user name and … Read more