cURL / Mailing Lists / curl-library / Single Mail


HTTP proxy authentication with wrong username:password hangs

From: Jane Liu <>
Date: Tue, 09 Dec 2003 10:59:34 -0500


  I need help.
  When I am using HTTP/HTTPS proxy authentication, if username:password
is correct, there is no problem. But if the username:password is wrong,
then the program using HTTP hangs, while the program using HTTPS will
tell me Proxy connect aborted. This is happening on both Linux and

Here is my code for Linux:

#include <stdio.h>
#include <curl/curl.h>
int main(void)
  CURL *curl;
  CURLcode res;
  FILE *fp;
  char *error_buffer[CURL_ERROR_SIZE];
  fp = fopen("/tmp/kill.exe", "wb");
  curl = curl_easy_init();
  if(curl) {
    /* First set the URL that is about to receive our POST. This URL can
       just as well be a https:// URL if that is what should receive the
       data. */
    curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error_buffer);
    curl_easy_setopt(curl, CURLOPT_URL,
    /* Now specify the POST data */
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_easy_setopt(curl, CURLOPT_PROXY,"");
    curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8095);
    curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "test:");
    /* Perform the request, res will get the return code */
    res = curl_easy_perform(curl);
    printf("res = %d, message: %s\n", res, error_buffer);
    /* always cleanup */
  return 0;

This email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now!
Received on 2003-12-09