cURL / Mailing Lists / curl-users / Single Mail

curl-users

[ curl-Bugs-484982 ] Redirect to HTTPS fails in some cases

From: <noreply_at_sourceforge.net>
Date: Fri, 23 Nov 2001 13:12:14 -0800

Bugs item #484982, was opened at 2001-11-23 13:12
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=484982&group_id=976

Category: http
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: Redirect to HTTPS fails in some cases

Initial Comment:
Hi.
I used your library and found a bug: I can not see a
page which redirects through a HTTPS connection. I
think this is happening because of the proxy server
but my IE5.0 has no problem doing the same thing.

I use:
curl 7.9.1 (win32) libcurl 7.9.1 (OpenSSL 0.9.6b)

My program use the static library.

---
#include "stdafx.h"
#include <stdio.h>
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
int main(int argc, char* argv[])
{
  int n;
	CURL *curl;
 // CURLcode res;
  FILE *content;
  char buf[CURL_ERROR_SIZE];
  buf[0]=0;
  curl_global_init(CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32);
  unlink("cookie.jar"); // fresh start
  curl = curl_easy_init();
  if(curl) {
	
	content=fopen("Data\Site\prima.html","w");
	curl_easy_setopt(curl, 
CURLOPT_URL, "http://safari.informit.com/");
	curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, 
buf);
	curl_easy_setopt(curl, CURLOPT_FILE, content);
	curl_easy_setopt(curl, 
CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.0; 
Windows 98)");
	curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 
1);
	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
	curl_easy_setopt(curl, 
CURLOPT_REFERER, "http://www.yahoo.com/");
	curl_easy_setopt(curl, 
CURLOPT_COOKIEFILE, "cookie.jar");
	curl_easy_setopt(curl, 
CURLOPT_COOKIEJAR, "cookie.jar");
	curl_easy_setopt(curl, 
CURLOPT_CONNECTTIMEOUT , 20); /* max 20 sec. for 
connecting */
	curl_easy_setopt(curl, 
CURLOPT_LOW_SPEED_LIMIT , 20); /* min 20 bytes/second 
*/
	curl_easy_setopt(curl, 
CURLOPT_PROXY , "cache.roedu.net:3128"); /* proxy at 
roedu */
	curl_easy_setopt(curl, CURLOPT_FAILONERROR , 
0); 
	
    while(curl_easy_perform(curl));
	fclose(content);
	content=fopen("Data\Site\login.html","w");
    curl_easy_setopt(curl, 
CURLOPT_URL, "http://safari.informit.com/mainhom.asp?
login");
	curl_easy_setopt(curl, 
CURLOPT_REFERER, "http://safari.informit.com/");
	//    while(curl_easy_perform(curl));
    curl_easy_perform(curl);
	fclose(content);
    /* always cleanup */
    curl_easy_cleanup(curl);
  }
  else
  {
	  printf("Curl==NULL\n");
	  fflush(stdout);
  }
  printf("Done!\n");
  curl_global_cleanup();
  scanf("%d",&n);
  return 0;
}
----
login.html:
----
<HTML><HEAD>
<TITLE>ERROR: The requested URL could not be 
retrieved</TITLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR>
<P>
While trying to retrieve the URL:
<A 
HREF="https://safari.informit.com/sec/mainin.asp?">http
s://safari.informit.com/sec/mainin.asp?</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Unsupported Request Method and Protocol
</STRONG>
</UL>
<P>
Squid does not support all request methods for all 
access protocols.
For example, you can not POST a Gopher request.
<P>Your cache administrator is <A 
HREF="mailto:webmaster">webmaster</A>. 
<br clear="all">
<hr noshade size=1>
Generated Fri, 23 Nov 2001 21:56:40 GMT by 
cache10.roedu.net (Squid/2.3.STABLE4)
</BODY></HTML>
----
Please tell me if I can be of any help.
Thank you.
 Daniel Negrea
----------------------------------------------------------------------
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=484982&group_id=976
Received on 2001-11-23