From: garakkio at gmail dot com Operating system: Debian Lenny PHP version: 5.2.10 PHP Bug Type: cURL related Bug description: curl doesn't correct proxy authentication header
Description: ------------ If you try to get an url via a proxy with authentication, curl sends a "Server auth" header instead of "Proxy Auth", making authentication impossible. If you try to get the same page using curl binary, the result is the expected one. The curl command corresponding to php reproduce code is: curl -v -xexample.org:80 -Ufoo:bar -o /dev/null http://www.google.com Reproduce code: --------------- <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://php.net'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_PROXY, 'http://example.org:80'); curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, 'foo:bar'); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_exec($ch); Expected result: ---------------- * About to connect() to proxy example.org port 80 (#0) * Trying 208.77.188.166... * connected * Connected to example.org (208.77.188.166) port 80 (#0) * Proxy auth using Basic with user 'foo' > GET http://php.net HTTP/1.1 Authorization: Basic Zm9vOmJhcg== Host: php.net Pragma: no-cache Accept: */* Proxy-Connection: Keep-Alive [...] Actual result: -------------- * About to connect() to proxy example.org port 80 (#0) * Trying 208.77.188.166... * connected * Connected to example.org (208.77.188.166) port 80 (#0) * Server auth using Basic with user 'foo' > GET http://php.net HTTP/1.1 Authorization: Basic Zm9vOmJhcg== Host: php.net Pragma: no-cache Accept: */* Proxy-Connection: Keep-Alive [...] -- Edit bug report at http://bugs.php.net/?id=48602&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48602&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48602&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48602&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48602&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48602&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48602&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48602&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48602&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48602&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48602&r=support Expected behavior: http://bugs.php.net/fix.php?id=48602&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48602&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48602&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48602&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48602&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48602&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48602&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48602&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48602&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48602&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48602&r=mysqlcfg