php - cURL HTTPS follow redirection -


i had below code working http url follow redirect , pass new page url on.

// follow url private function follow_url($url) {     $options = array(          curlopt_returntransfer => true,     // return web page          curlopt_header         => true,    // return headers          curlopt_followlocation => true,     // follow redirects          curlopt_encoding       => "",       // handle encodings          curlopt_useragent      => "spider", //          curlopt_autoreferer    => true,     // set referer on redirect          curlopt_connecttimeout => 120,      // timeout on connect          curlopt_timeout        => 120,      // timeout on response          curlopt_maxredirs      => 10,       // stop after 10 redirects      );       $ch      = curl_init( $url );      curl_setopt_array( $ch, $options );      $content = curl_exec( $ch );      $err     = curl_errno( $ch );      $errmsg  = curl_error( $ch );      $header  = curl_getinfo( $ch );      curl_close( $ch );       $output = $header["url"];     return $output; }  

i trying work https not follow on stops @ inputted url.

is there can fix this?

add following options:

curlopt_ssl_verifyhost => false, curlopt_ssl_verifypeer => false, 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -