ID: 43158
User updated by: p dot vanbrouwershaven at networking4all dot com
Reported By: p dot vanbrouwershaven at networking4all dot com
-Status: Feedback
+Status: Open
Bug Type: cURL related
Operating System: Linux *** 2.6.8-2-686 #1 Tue Au
PHP Version: 5.2.4
New Comment:
I tried with php5.2-200807211030 but the problem still exists.
curl_error returns:
SSL: certificate subject name 'www.verisign.com' does not match target
host name 'verisign.com'
curl_getinfo returns:
Array
(
[url] => https://verisign.com/
[content_type] => text/html
[http_code] => 301
[header_size] => 182
[request_size] => 135
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 1.072121
[namelookup_time] => 0.184282
[connect_time] => 0.342402
[pretransfer_time] => 0.905169
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => 0
[upload_content_length] => 0
[starttransfer_time] => 1.07203
[redirect_time] => 0
[certinfo] =>
)
Previous Comments:
------------------------------------------------------------------------
[2008-07-18 00:56:21] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
------------------------------------------------------------------------
[2007-10-31 11:35:19] p dot vanbrouwershaven at networking4all dot com
There was a space in my post just before http:// this is not the
problem but just an error in my post.
$url = ' https://verisign.com';
Array
(
[url] => https://verisign.com
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0
[namelookup_time] => 3.5E-05
[connect_time] => 0.155727
[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
)
------------------------------------------------------------------------
[2007-10-31 10:51:45] p dot vanbrouwershaven at networking4all dot com
Description:
------------
I have some problems with the curl. On the console I get the right
response message but in PHP I see no difference between a valid and an
invalid SSL Certificate.
Curl command in PHP:
$url = ' https://verisign.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLE_OPERATION_TIMEOUTED, 10);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
$result = curl_exec ($ch);
$info = curl_getinfo($ch);
curl_close ($ch);
print_r($info);
Curl command on console:
curl -I https://verisign.com
Console result:
curl -I https://verisign.com
curl: (51) SSL: certificate subject name 'www.verisign.com' does not
match target host name 'verisign.com'
PHP Result:
[ssl_verify_result] => 0
Reproduce code:
---------------
$url = ' https://verisign.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLE_OPERATION_TIMEOUTED, 10);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
$result = curl_exec ($ch);
$info = curl_getinfo($ch);
curl_close ($ch);
print_r($info);
Expected result:
----------------
Array
(
[url] => https://verisign.com
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 51
[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
)
Actual result:
--------------
Array
(
[url] => https://verisign.com
[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
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43158&edit=1