ID: 48602 Comment by: sjoerd-php at linuxonly dot nl Reported By: garakkio at gmail dot com Status: Open Bug Type: cURL related Operating System: Debian Lenny PHP Version: 5.2.10 New Comment:
Thank you for your bug report. Do you try to authenticate to the proxy (example.org) or to the destination server (php.net)? Have you looked at the CURLOPT_PROXYUSERPWD option? In your bug report, the expected result and actual result appear to be the same text. Could you clarify this? Previous Comments: ------------------------------------------------------------------------ [2009-06-19 11:04:41] garakkio at gmail dot com 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 this bug report at http://bugs.php.net/?id=48602&edit=1