cURL / Mailing Lists / curl-users / Single Mail

curl-users

[ curl-Bugs-487825 ] Redirect to HTTPS

From: <noreply_at_sourceforge.net>
Date: Sat, 01 Dec 2001 05:15:50 -0800

Bugs item #487825, was opened at 2001-12-01 05:15
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=487825&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

Initial Comment:
Hi.
 I am sorry for my last post. I am not used with this
kind of things.

 When I run the fallowing program I get an error from
curl_easy_perform(): CURLE_HTTP_NOT_FOUND(22).

 When I give that link from IE5.0 with the same proxy
settings, I don't have any problem.

 If replace http with https in the url then everything
works fine.

test3.cpp
-------------------------------------------
#include "stdafx.h"

#include <stdio.h>
#include <stdlib.h>
#include <io.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>

int main(int argc, char* argv[])
{

  CURL *curl;
  CURLcode res;
  FILE *content;
  int fdout;

  fdout=_open( "OUT.TXT", _O_WRONLY | _O_CREAT,
_S_IREAD | _S_IWRITE );
  
  int fderr=2;
  _close(fderr);
  _dup2(fdout,fderr);

  curl_global_init(CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32);

  unlink("cookie.jar"); // fresh start

  curl = curl_easy_init();
  if(curl) {
  
          content=fopen("content.txt","wb");
        curl_easy_setopt(curl,
CURLOPT_URL, "http://safari.informit.com/mainhom.asp?
login");
        curl_easy_setopt(curl, CURLOPT_FILE, content);

        curl_easy_setopt(curl,
CURLOPT_PROXY , "cache.roedu.net:3128"); /* proxy at
roedu */

        curl_easy_setopt(curl,
CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.0;
Windows 98)");
        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_FOLLOWLOCATION,
1);
        curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
        curl_easy_setopt(curl, CURLOPT_FAILONERROR ,
1);
        curl_easy_setopt(curl, CURLOPT_NOPROGRESS ,0);
        curl_easy_setopt(curl, CURLOPT_HEADER , 1);
        
        
        res=curl_easy_perform(curl);
        
        fclose(content);
        
        curl_easy_cleanup(curl);

        _close(fderr);
  }
        return 0;
}
-----------END Test3.cpp ---------------------
OUT.txt
----------------------------------------------
* Connected to cache.roedu.net (141.85.128.29)
> GET http://safari.informit.com/mainhom.asp?login
HTTP/1.1

User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows
98)

Host: safari.informit.com

Pragma: no-cache

Accept: image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*

Referer: http://www.yahoo.com/

* HTTP/1.0 proxy connection set to keep alive!
* Follow to new URL: main.asp?login
  % Total % Received % Xferd Average
Speed Time Curr.
                                 Dload Upload
Total Current Left Speed

  0 135 0 0 0 0 0 0 --:--:--
  0:00:00 --:--:-- 0
* Connection #0 left intact
* Follows Location: to new
URL: 'http://safari.informit.com/main.asp?login'
* Disables POST, goes with GET
* Re-using existing connection! (#0)
* Connected to cache.roedu.net (141.85.128.29)
> GET http://safari.informit.com/main.asp?login
HTTP/1.1

User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows
98)

Host: safari.informit.com

Pragma: no-cache

Accept: image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*

Referer: http://www.yahoo.com/

Cookie: ASPSESSIONIDQGQQGLJC=PGKKPCBCKOLCEKDHOGMPMEBG;
safari=interface=informit; SafariSticky=193%2E194%
2E158%2E160

* HTTP/1.0 proxy connection set to keep alive!
* Follow to new URL:
https://safari.informit.com/sec/mainin.asp?login

  0 169 0 0 0 0 0 0 --:--:--
  0:00:01 --:--:-- 0
* Connection #0 left intact
* Follows Location: to new
URL: 'https://safari.informit.com/sec/mainin.asp?login'
* Disables POST, goes with GET
* Re-using existing connection! (#0)
* Connected to cache.roedu.net (141.85.128.29)
> GET https://safari.informit.com/sec/mainin.asp?login
HTTP/1.1

User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows
98)

Host: safari.informit.com

Pragma: no-cache

Accept: image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*

Referer: http://www.yahoo.com/

Cookie: ASPSESSIONIDQGQQGLJC=PGKKPCBCKOLCEKDHOGMPMEBG;
safari=interface=informit; SafariSticky=193%2E194%
2E158%2E160

  0 169 0 0 0 0 0 0 --:--:--
  0:00:01 --:--:-- 0
  0 169 0 0 0 0 0 0 --:--:--
  0:00:02 --:--:-- 0
  0 169 0 0 0 0 0 0 --:--:--
  0:00:04 --:--:-- 0
* Connection #0 left intact
* Closing connection #0
-----------------END OUT.TXT------------------------
content.txt
----------------------------------------------------
HTTP/1.0 302 Moved Temporarily
Server: Microsoft-IIS/5.0
Date: Sat, 01 Dec 2001 13:03:50 GMT
Pragma: no-cache
Location: main.asp?login
Content-Length: 135
Content-Type: text/html
Expires: Sat, 01 Dec 2001 13:02:51 GMT
Set-Cookie: SafariSticky=193%2E194%2E158%2E160; path=/
Set-Cookie: safari=interface=informit; path=/
Set-Cookie:
ASPSESSIONIDQGQQGLJC=PGKKPCBCKOLCEKDHOGMPMEBG; path=/
Cache-Control: private
X-Cache: MISS from cache10.roedu.net
Proxy-Connection: keep-alive

HTTP/1.0 302 Moved Temporarily
Server: Microsoft-IIS/5.0
Date: Sat, 01 Dec 2001 13:03:51 GMT
Pragma: no-cache
Location: https://safari.informit.com/sec/mainin.asp?
login
Content-Length: 169
Content-Type: text/html
Expires: Sat, 01 Dec 2001 13:02:51 GMT
Set-Cookie: safari=interface=informit; path=/
Cache-Control: private
X-Cache: MISS from cache10.roedu.net
Proxy-Connection: keep-alive
---------------------END content.txt----------------

I couldn't figure out how to upload more than one file
in this form.

Thank you.

----------------------------------------------------------------------

You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=487825&group_id=976
Received on 2001-12-01