The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CURL issues

Discussion in 'General Discussion' started by Vinayak, Jun 7, 2013.

  1. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    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.
     
    #1 Vinayak, Jun 7, 2013
    Last edited by a moderator: Jun 7, 2013
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    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
     
    #3 Vinayak, Jun 7, 2013
    Last edited: Jun 7, 2013
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  5. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Bharat
    cPanel Access Level:
    Root Administrator
    Its not about pinterest, in the browser its not working for other targets too, the result I mentioned in the OP is from browser, whereas from SSH the result is in my last reply above.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  7. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Bharat
    cPanel Access Level:
    Root Administrator
    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($chCURLOPT_URL$url); 
      
    curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"); 
      
    curl_setopt($chCURLOPT_RETURNTRANSFER1); 
      
    curl_setopt($chCURLOPT_TIMEOUT10); 
      
    curl_setopt($chCURLOPT_CONNECTTIMEOUT10);
      
    $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
     
  8. billckr

    billckr Member

    Joined:
    Jan 26, 2005
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  9. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Bharat
    cPanel Access Level:
    Root Administrator
    It's not about Pinterest, its about that particular server on which the script is not working for any of the targets.
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  11. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Bharat
    cPanel Access Level:
    Root Administrator
    I had tried with CSF disabled, result was same.

    Will surely open a ticket.
     
  12. TND

    TND Member

    Joined:
    Jul 9, 2012
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    do you have any update? i'm submit ticket but my supporter can't resolved this problem.
     
  13. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Bharat
    cPanel Access Level:
    Root Administrator
    There was no solution to that at that time. But then for other reasons I had to change the server, so did not bothered to find the solution.
     
  14. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Can you please post the ticket number so that we can follow up on this?
     
  15. TND

    TND Member

    Joined:
    Jul 9, 2012
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Dear Jared
    Support Request Id is: 4399805

    Thank you
     
  16. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    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.
     
  17. TND

    TND Member

    Joined:
    Jul 9, 2012
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Sorry for my comment because my english is bad.Please remove the #15
    i'm sorry about that. I will update in ticket
     
  18. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  19. proinagltd

    proinagltd Registered

    Joined:
    Feb 13, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    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
     
  20. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, please see my previous post to this thread. Remember to open a new thread if you are experiencing a different issue.

    Thank you.
     
Loading...

Share This Page