cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1172 curl-7.28.1: PHP curl_getinfo misbehavior

From: AdoY <adoy_at_users.sf.net>
Date: Wed, 19 Dec 2012 04:49:32 +0000

This bug is not a libcurl bug, but a PHP/cURL binding problem (introduced by the CURLOPT_SSL_VERIFYHOST) and is explained in the php bug : https://bugs.php.net/bug.php?id=63795

---
** [bugs:#1172] curl-7.28.1: PHP curl_getinfo misbehavior**
**Status:** pending
**Labels:** SSL/TLS 
**Created:** Tue Dec 11, 2012 08:57 PM UTC by Anthony G. Basile
**Last Updated:** Thu Dec 13, 2012 10:04 AM UTC
**Owner:** Daniel Stenberg
Commit da82f59b697310229ccdf66104d5d65a44dfab98 ends support for  CURLOPT\_SSL\_VERIFYHOST =&gt; 1.   Using it in a php script still returns values for curl\_getinfo\(\) and curl\_multi\_getcontent\(\), however, it is not as it should be since the head of the returned HTML is cut off.  For example, using the following script 
&lt;?php
$cm = curl\_multi\_init\(\);
$stuffs = curl\_init\(\);
$curl\_options = array\(
CURLOPT\_URL =&gt; 'http://www.google.ca',
CURLOPT\_RETURNTRANSFER =&gt; 1,
CURLOPT\_SSL\_VERIFYHOST =&gt; 1,    // toggle 0/1 to test
CURLOPT\_SSL\_VERIFYPEER =&gt; 1,
CURLOPT\_HEADER =&gt; 1
\);
curl\_setopt\_array\($stuffs, $curl\_options\);
curl\_multi\_add\_handle\($cm, $stuffs\);
do \{ curl\_multi\_exec\($cm, $running\); \} while\($running &gt; 0\);
$content = curl\_multi\_getcontent\($stuffs\);
$info = curl\_getinfo\($stuffs\);
curl\_multi\_remove\_handle\($cm, $stuffs\);
curl\_multi\_close\($cm\);
print\_r\($info\);
// cuts off too much, the header size is incorrect
echo mb\_substr\($content, $info\['header\_size'\]\);
?&gt;
we get
0473,4000567,4000955,4001042,4001372,4001416,4001569,4001959,4001966,4002000,4002036,4002048,4002161,4002240,4002348,4002359,4002378,4002391,4002436,4002460,4002510,4002562,4002707,4002710,4002733,4002756,4002768,4002773,4002786,4002789,4002868,4002883",ei:"X2bFUMOTFOr-2QWDuYCgDg"\},authuser:0,ml:function\(\)\{\},kHL:"en",time:function\(\)\{return\(new ....
with "&lt;\!doctype html&gt;&lt;html" cut off.  Setting CURLOPT\_SSL\_VERIFYHOST =&gt; 0 fixes it.  Of course, reverting to pre da82f5 "fixes" it to, but as noted in the commit message, this is not a good idea.
Thanks to Andrew Saunders for isolating the issue\!  See the downstream bug for more info.
https://bugs.gentoo.org/show\_bug.cgi?id=444788
---
Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/curl/bugs/1172/>
To unsubscribe from further messages, please visit <https://sourceforge.net/auth/prefs/>
Received on 2012-12-19

These mail archives are generated by hypermail.

donate! Page updated January 05, 2012.
web site info

File upload with ASP.NET