HTTPS/Curl always returning false Ubuntu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

HTTPS/Curl always returning false Ubuntu

Post by panic! »

Hi all,

I've having a problem with one of my servers: anytime I try and curl a secure URL it returns false, when exactly the same script on the other server returns the page content.

I'm thinking I might have to install some SSL related package on the server but I've tried loads and they all seem to be installed.

Both servers are Ubuntu 8.10

Code: Select all

<?
    $url='https://www.cia.gov/';
    $ch = curl_init ($url);
      $result = curl_exec ($ch); 
      
      
      print $result;
    
    
    
    curl_close ($ch);
   if ( $result == false ){
      print "false";
      }
      else
      {
        print "success";
      }
    return $result;
 
 
 
    ?>
Thanks all.
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: HTTPS/Curl always returning false Ubuntu

Post by panic! »

Why immediately after posting something i've been trying to figure out for an hour do I find the solution?



sudo apt-get install ca-certificates
Post Reply