Vinayak

Well-Known Member
Jun 27, 2003
281
2
168
Bharat
cPanel Access Level
Root Administrator
I am facing this issue with curl on a box, followed several solution (from here too /http://curl.haxx.se/docs/sslcerts.html) , updated /etc/pki/tls/certs/ca-bundle.crt, checked permissions, but no success.

Server environment is
CENTOS 6.4 x86_64 standard
WHM 11.38.0 (build 15)

CurlSSL selected in EasyApache.

Any idea how to fix this?
Code:
Testing ... http://www.google.com/intl/en/contact/ - http://www.google.com/intl/en/contact/
....HTTP to Google - OK
Testing ... https://www.google.com/intl/en/contact/ - https://www.google.com/intl/en/contact/
[COLOR="#FF0000"][B]....HTTPS to Google - Problem[/B][/COLOR]
error setting certificate verify locations:
  CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
Array
(
    [url] => https://www.google.com/intl/en/contact/
    [content_type] => 
    [http_code] => 0
    [header_size] => 0
    [request_size] => 0
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.002201
    [namelookup_time] => 0.000768
    [connect_time] => 0.00221
    [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
    [certinfo] => Array
        (
        )

    [redirect_url] => 
)
There is a problem with cURL. You need to contact your server admin or hosting provider.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello :)

That error typically occurs when the CABundle does not exist or has invalid permissions. Please verify that the CABundle exists and check it's permissions with a command such as:

Code:
# stat /etc/pki/tls/certs/ca-bundle.crt
Thank you.
 

Vinayak

Well-Known Member
Jun 27, 2003
281
2
168
Bharat
cPanel Access Level
Root Administrator
File is there and below are the permissions.
Code:
# stat /etc/pki/tls/certs/ca-bundle.crt
  File: `/etc/pki/tls/certs/ca-bundle.crt'
  Size: 251338          Blocks: 496        IO Block: 4096   regular file
Device: 805h/2053d      Inode: 12582959    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-06-07 11:25:32.185991721 -0500
Modify: 2013-05-14 03:48:04.000000000 -0500
Change: 2013-06-07 11:25:02.723786176 -0500
From SSH it works fine except for pinterest.com

Example
Code:
Testing ... [url=http://www.google.com/intl/en/contact/]Contact us ? Contact us ? Google[/url] - http://www.google.com/intl/en/contact/<br />
....HTTP to Google - OK<br />
Testing ... [url]https://www.google.com/intl/en/contact/[/url] - https://www.google.com/intl/en/contact/<br />
....HTTPS to Google - OK<br />
Testing ... [url]https://www.facebook.com/[/url] - https://www.facebook.com/<br />
....HTTPS to Facebook - OK<br />
Testing ... [url]https://www.linkedin.com/[/url] - https://www.linkedin.com/<br />
....HTTPS to LinkedIn - OK<br />
Testing ... [url]https://twitter.com/[/url] - https://twitter.com/<br />
....HTTPS to Twitter - OK<br />
Testing ... [url]https://pinterest.com/join/signup/[/url] - https://pinterest.com/join/signup/<br />
....<b style='color:red;'>HTTPS to Pinterest - Problem</b><br />
<pre>Array
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
The fact that it's working for other providers and not for Pinterest indicates an issue with the connection to the Pinterest server as opposed to it being an issue with cURL itself. Do you have any firewall rules that could be filtering outbound traffic?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
You can verify if cURLSSL is enabled with a command such as:

Code:
# php -m|grep curl
If it's enabled, and working via the command line, then it's possible there is an issue with the script you are utilizing it with. Are you using a specific PHP application that is failing, or is it failing for multiple applications?

Thank you.
 

Vinayak

Well-Known Member
Jun 27, 2003
281
2
168
Bharat
cPanel Access Level
Root Administrator
# php -m|grep curl
curl
Script is working on other servers and not working on this particular server. Below is the test script

PHP:
<?php
function nxs_cURLTest($url, $msg, $testText){  
  $ch = curl_init(); 
  curl_setopt($ch, CURLOPT_URL, $url); 
  curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"); 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  curl_setopt($ch, CURLOPT_TIMEOUT, 10); 
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
  $response = curl_exec($ch); 
  $errmsg = curl_error($ch); 
  $cInfo = curl_getinfo($ch); 
  curl_close($ch); 
  echo "Testing ... ".$url." - ".$cInfo['url']."<br />";
  if (stripos($response, $testText)!==false) 
    echo "....".$msg." - OK<br />"; 
  else 
  { 
    echo "....<b style='color:red;'>".$msg." - Problem</b><br /><pre>"; 
    print_r($errmsg); 
    print_r($cInfo); 
    print_r(htmlentities($response)); 
    echo "</pre>There is a problem with cURL. You need to contact your server admin or hosting provider.";
  }
}

 nxs_cURLTest("http://www.google.com/intl/en/contact/", "HTTP to Google", "Mountain View, CA");
 nxs_cURLTest("https://www.google.com/intl/en/contact/", "HTTPS to Google", "Mountain View, CA");
 nxs_cURLTest("https://www.facebook.com/", "HTTPS to Facebook", 'id="facebook"');
 nxs_cURLTest("https://www.linkedin.com/", "HTTPS to LinkedIn", 'link rel="canonical" href="https://www.linkedin.com/"');
 nxs_cURLTest("https://twitter.com/", "HTTPS to Twitter", 'link rel="canonical" href="https://twitter.com/"');
 nxs_cURLTest("https://pinterest.com/join/signup/", "HTTPS to Pinterest", 'content="Pinterest"');
?>
Client reported that it was working fine few days back, actual script that stopped working is
Social Networks Auto Poster {SNAP} - Free plugin for WordpressNextScripts
 

billckr

Member
Jan 26, 2005
5
0
151
This script works fine for me on three servers.

+ WHM 11.36.1 (build 8)
+ Barebones CentOS 5
+ DA 1.43.0 CentOS 5

The Pintrist fails on each of them. That's their fault not the server your on.
 

Vinayak

Well-Known Member
Jun 27, 2003
281
2
168
Bharat
cPanel Access Level
Root Administrator
This script works fine for me on three servers.

+ WHM 11.36.1 (build 8)
+ Barebones CentOS 5
+ DA 1.43.0 CentOS 5

The Pintrist fails on each of them. That's their fault not the server your on.
It's not about Pinterest, its about that particular server on which the script is not working for any of the targets.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Do you have any firewall rules that could be filtering outbound traffic? If not, feel free to submit a ticket and we can take a closer look:

Submit A Ticket

You can post the ticket number here so we can keep this thread updated.

Thank you.
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
Ticket 4399805 is about a CSRF state token problem, which does not appear to be related to the cURL problem discussed in this forum thread. You replied to ticket 4399805 about two different problems that are not related to the CSRF problem: a "Fatal error: Uncaught CurlException" message, which was forked into ticket 4405389, and a yum repo problem, which was forked into ticket 4405393.

We require that each ticket be limited to only one question or problem, and we ask you to submit a new ticket for a new problem, instead of replying to an existing unrelated ticket.

In the original ticket, 4399805, which was for a CSRF problem, not a cURL problem, we did tell you that there is a coding problem that is beyond our scope of support. Other than that, I do not see in any of these three tickets that any "supporter" could not solve your problems.

In the ticket system, we support our product, cPanel. When a problem is not directly related to or caused by cPanel, such as a problem in a site script's coding, we will tell you so, but we will also, when possible, try to give you some resources you can use to solve the problem yourself.

I replied to ticket 4405393 myself, to explain that custom yum repos are beyond our scope of support, but as a courtesy, I did offer you a way to fix the problem yourself.

Ticket 4405389, about the cURL problem, is waiting for a reply. We answer complimentary tickets in the order they are received, so there can sometimes be a delay before we can reply. Note that the cURL problem has not yet been investigated by us and we have not told you that we cannot fix it.
 

TND

Member
Jul 9, 2012
10
0
1
cPanel Access Level
DataCenter Provider
Ticket 4405389, about the cURL problem, is waiting for a reply. We answer complimentary tickets in the order they are received, so there can sometimes be a delay before we can reply. Note that the cURL problem has not yet been investigated by us and we have not told you that we cannot fix it.
Sorry for my comment because my english is bad.Please remove the #15
i'm sorry about that. I will update in ticket
 

proinagltd

Registered
Feb 13, 2014
1
0
1
cPanel Access Level
Root Administrator
Hi All

Did this get resolved? I can curl from SSH to the domain, have curl_ssl enabled. I don't believe any firewall blocking. Seams to be timeing out.

Graham