Jump to content
php.lv forumi

cURL un HTTPS


Joyride

Recommended Posts

Sveiki. Ir vajadziba iegut failu no interneta. Lai to izdaritu, meginaju sadi:

 

$user = 'user';
$pass= 'pass';
$url = 'https://blah.blah.tld/xml/listener.asmx/CategoryList?Username=' . $user . '&Password=' . $pass;
curl_setopt($CURL, CURLOPT_URL, $url);
curl_setopt($CURL, CURLOPT_HEADER, 0);
curl_setopt($CURL, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($CURL);
echo "Error is: " . curl_error($CURL);
echo $output;
curl_close($CURL);

 

...bet no si nekas neiznak. Pec apm 20sec (pec xDebug trace datiem), uz ekrana paradas "Error is: couldn't connect to host" un viss. Adrese ir pareiza, jo, ievadot browseri to visu, tiek smuki atgriezti xml dati. Kas par vainu varetu but?

Link to comment
Share on other sites

Jaa, tas ir Elko, kush :)

 

Firewalls nav, bet esmu aiz Squid, vai tas var kaut ko ietekmet?

 

Ja tas ko palidz, tad curl_getinfo() atgriez luk ko:

 

Array
(
[url] => blah
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0
[namelookup_time] => 0
[connect_time] => 0
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => 0
[upload_content_length] => 0
[starttransfer_time] => 0
[redirect_time] => 0
)

Edited by Joyride
Link to comment
Share on other sites

×
×
  • Create New...