Good day..
I have a web app that makes requests to another server through proxies. Now i would say 99% of these requests works completely fine hand i have no issue what so ever and receive the response back.
However some requests ( again a very few amount ) will return HTTP response code 0, which means curl failed. After debug with curl_error i have collected these 2 errors.
- OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to URL.
- Operation timed out after 7000 milliseconds with 0 out of 0 bytes received
Now the second one is self explanatory. Surely the SSL error is just due to a dodgy proxy otherwise i would get this response with every request and not just 1% ( to the same urls ) ? im pretty sure my curl config is ok. ( below ).
curl_setopt_array($this->ch, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_AUTOREFERER => 1,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POST => 0,
CURLOPT_ENCODING => 'gzip',
CURLOPT_HEADER => 0
));
Should i just add a curl exec retry if response is nothing / code = 0 ?
Thank you.