cURL / Mailing Lists / curl-library / Single Mail

curl-library

Connection-Close not recognised by Https over Proxy with Authentication

From: Source <source_at_stueben.com>
Date: Thu, 26 Oct 2006 18:43:56 +0200

When using the Jana-Server2 with authentication to access a https-Server,
the JANA-Server sends a Connection-Close on first access without password.
Curl sends the second request with the password on the same handle which
is then not accepted by the Jana-server.

If Authentication BASIC is selected in Curl, it works, for Curl does only
need one attempt.

Configuration: All programs on localhost
Apache-Server ssl on 443
Jana-Server as Proxy on 3128

Part of the test-program:

curl_easy_setopt( curl, CURLOPT_VERBOSE, TRUE );
curl_easy_setopt( curl, CURLOPT_HEADER, TRUE );
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, eBuffer);
curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

curl_easy_setopt( curl, CURLOPT_URL, "https://127.0.0.1:443/xampp/" );
curl_easy_setopt(curl, CURLOPT_POST, 1 );
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, xml);

curl_easy_setopt(curl, CURLOPT_USERAGENT, "TestCurlProxyAuth");

curl_easy_setopt( curl, CURLOPT_PROXY, "127.0.0.1" );
curl_easy_setopt( curl, CURLOPT_PROXYPORT, 3128 );
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "olaf:test" );
curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY );
curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, TRUE);

curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0 );
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0 );

curlRc = curl_easy_perform(curl);

Log:
* About to connect() to proxy 127.0.0.1 port 3128
* Trying 127.0.0.1... * connected
* Connected to 127.0.0.1 (127.0.0.1) port 3128
* Establish HTTP proxy tunnel to 127.0.0.1:443
> CONNECT 127.0.0.1:443 HTTP/1.0
Host: 127.0.0.1:443
User-Agent: TestCurlProxyAuth
Proxy-Connection: Keep-Alive

< HTTP/1.0 407 Proxy Authentication Required
< Server: Jana-Server/2.4.8.51
< Date: Thu, 26 Oct 2006 13:19:06 GMT
< Content-Length: 6729
< Content-Type: text/html; charset=iso-8859-1
< Proxy-Authenticate: Basic realm="Jana Server"
< Expires: Thu, 26 Oct 2006 13:19:06 GMT
< Pragma: no-cache
< Connection: close
<
* Ignore 6729 bytes of response-body
* Proxy auth using Basic with user 'olaf'
> CONNECT 127.0.0.1:443 HTTP/1.0
Host: 127.0.0.1:443
Proxy-Authorization: Basic b2xhZjp0ZXN0
User-Agent: TestCurlProxyAuth
Proxy-Connection: Keep-Alive

* Proxy CONNECT aborted
* Closing connection #0
Received on 2006-10-26