cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: a problem

From: <rmitchell_at_eds.com>
Date: Sat, 13 Jul 2002 02:47:08 -0500

Looks you're definitely going to have a cookie problem - you didn't specify
the cookie save/use flags at all, so curl doesn't fire up its cookie engine.
Also, did you really mean '-d testdoc.out' - the -d flag is for passing
'variable=value' during a form post... Maybe that should be -o for saving the
output to a file?

Try it like this:

    curl -A "Mozilla/4.0" -L -i -v -o testdoc.out -u <username>:<passwd> -b
cookie.jar -c cookie.jar https://xx.xxx.xxx.xxx/testdoc.out

    -b cookie.jar makes sure the cookie parser gets going
    -c cookie.jar tells curl to save the cookies at the end of the
run. You could leave that out if you don't plan on going back to the site
with old cookies.

Ralph Mitchell

doug chanco wrote:

> Hi all,
> I am new to curl and having a really hard time doing something that
> appears to be simple:
>
> I am attempting to get a file off of a secure web site....
>
> I have the latest version of curl:
>
> curl -V
>
> curl 7.9.8 (i586-pc-linux-gnu) libcurl 7.9.8 (OpenSSL 0.9.6b)
>
> I am running red hat 7.3
>
> here is my curl command:
>
> curl -A "Mozilla/4.0" -L -i -v -get -d testdoc.out -u
> <username>:<passwd> https://xx.xxx.xxx.xxx/testdoc.out
>
> below is the output :
>
> HTTP/1.1 302 Found
> Date: Fri, 12 Jul 2002 14:59:03 GMT
> Server: Apache/1.3.12 (Win32) mod_ssl/2.6.4 OpenSSL/0.9.6
> SecureTransportWWW/3.0.3
> Set-Cookie: FDX=PS7ut8CoPQcAAAjUPS4; path=/
> Location:
> https://xx.xxx.xxx.xxx:443/testdoc.out?&STCO=1PS7ut8CoPQcAAAjUPS4&STCOEND^M
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=iso-8859-1
>
> HTTP/1.1 302 Found
> Date: Fri, 12 Jul 2002 14:59:05 GMT
> Server: Apache/1.3.12 (Win32) mod_ssl/2.6.4 OpenSSL/0.9.6
> SecureTransportWWW/3.0.3^M
> Set-Cookie: FDX=PS7ut8CoPQcAAAjUPS4; path=/
> Location:
> https://xx.xxx.xxx.xxx/testdoc.out?&STCO=2PS7ut8CoPQcAAAjUPS4&STCOEND^M
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=iso-8859-1
>
> HTTP/1.1 302 Found
> Date: Fri, 12 Jul 2002 14:59:07 GMT
> Server: Apache/1.3.12 (Win32) mod_ssl/2.6.4 OpenSSL/0.9.6
> SecureTransportWWW/3.0.3^M
> Set-Cookie: FDX=PS7ut8CoPQcAAAjUPS4; path=/
> Location: https://xx.xxx.xxx.xxx/testdoc.out
>
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=iso-8859-1
>
> HTTP/1.1 401 Authorization Required
> Date: Fri, 12 Jul 2002 14:59:10 GMT
> Server: Apache/1.3.12 (Win32) mod_ssl/2.6.4 OpenSSL/0.9.6
> SecureTransportWWW/3.0.3
> WWW-Authenticate: Basic realm="FileDriveWWW"
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=iso-8859-1
>
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <HTML><HEAD>
> <TITLE>401 Authorization Required</TITLE>
> </HEAD><BODY>
> <H1>Authorization Required</H1>
> This server could not verify that you
> are authorized to access the document
> requested. Either you supplied the wrong
> credentials (e.g., bad password), or your
> browser doesn't understand how to supply
> the credentials required.<P>
>
> I am leaning towards a cookie problem but I am not sure...... if anyone
> has any suggestions, ideas or things to do/try please let me know!
>
> thanks a lot!
>
> dougc
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Gadgets, caffeine, t-shirts, fun stuff.
> http://thinkgeek.com/sf

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-07-13