Having an issue using curl and ssl all of a sudden. I think this 'might' be related to switching from EA3 to EA4 awhile back and/or using autossl certs through WHM.
I am testing using the following script from the site in question and curlopt_url set to itself :
which when viewed in the browser returns :
The cert for this domain is fine. All other ssl works fine for this domain. The nat firewall looks fine and so on. I double checked EA4 in WHM and php72-php-curl is installed as it has been (7.2.6-1.1.4.cpanel). The only thing I could find which may be related is in the MultiPHP INI Editor where these values are commented out :
Any ideas as to what I should be looking for and checking to get this working properly? If I change curlopt_url to something like Google then the script runs fine and returns no errors.
I am testing using the following script from the site in question and curlopt_url set to itself :
Code:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Uncomment this for Windows.
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, "https://www.site.com");
$result = curl_exec($ch);
echo '<pre>';
print_r(curl_getinfo($ch));
echo '</pre>';
echo 'Errors: ' . curl_errno($ch) . ' ' . curl_error($ch) . '<br><br>';
curl_close ($ch);
echo $result . 'EOF';
?>
Code:
Array
(
=> https://www.site.com/ [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.004557 [namelookup_time] => 0.00443 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) [primary_port] => 0 [local_ip] => [local_port] => 0 ) Errors: 7 Failed to connect to www.site.com port 443: Connection refused EOF
Code:
[curl] ; A default value for the CURLOPT_CAINFO option. This is required to be an ; absolute path. ;curl.cainfo = [openssl] ; The location of a Certificate Authority (CA) file on the local filesystem ; to use when verifying the identity of SSL/TLS peers. Most users should ; not specify a value for this directive as PHP will attempt to use the ; OS-managed cert stores in its absence. If specified, this value may still ; be overridden on a per-stream basis via the "cafile" SSL stream context ; option. ;openssl.cafile= ; If openssl.cafile is not specified or if the CA file is not found, the ; directory pointed to by openssl.capath is searched for a suitable ; certificate. This value must be a correctly hashed certificate directory. ; Most users should not specify a value for this directive as PHP will ; attempt to use the OS-managed cert stores in its absence. If specified, ; this value may still be overridden on a per-stream basis via the "capath" ; SSL stream context option. ;openssl.capath=
Last edited by a moderator: