cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: libcurl in perl - username/password pop up box

From: <Kenneth.Quan_at_wellsfargo.com>
Date: Wed, 22 Oct 2003 11:03:00 -0700

bash-2.03$ curl --version
curl 7.10.5 (sparc-sun-solaris2.8) libcurl/7.10.5 OpenSSL/0.9.7a zlib/1.1.3
with WWW-Curl 2.0 perl mod.

as you suggested, with command tool

curl -v -u user:pass http://protected-url -D header.out
The only thing in header.out is
HTTP/1.0 200 OK
Server: atg.server.http.HttpServer
Content-Type: text/html

in the normal verbose output, only lines i see of importance may be the
following:

* About to connect() to server.com:20030
* Connected to server.com (10.x.x.x) port 20030
> GET /atg/dynamo/admin/performance.jhtml HTTP/1.1
Authorization: Basic a3F1YW46NFF1QG4=
User-Agent: curl/7.10.5 (sparc-sun-solaris2.8) libcurl/7.10.5 OpenSSL/0.9.7a
zlib/1.1.3
Host: server.com:20030
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

< HTTP/1.0 200 OK
< Server: atg.server.http.HttpServer
< Content-Type: text/html

Turning on CURLOPT_VERBOSE to TRUE in perl, I get pretty much the same as
before

HTTP/1.0 401 Unauthorized
Server: atg.server.http.HttpServer
WWW-Authenticate: Basic realm="Dynamo Admin Server"
Content-Type: text/html

I'm wondering is it because of my stupid with the following line.. I'm using
@ in p_at_ass to show as an example because my password has an @ sign.

$curl->setopt(CURLOPT_USERPWD, "user:p_at_ss");

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Wednesday, October 22, 2003 4:55 AM
To: Curl Mailinglist
Subject: Re: libcurl in perl - username/password pop up box

On Tue, 21 Oct 2003 Kenneth.Quan_at_wellsfargo.com wrote:

> I'm trying to use libcurl in perl to accomplish the following task, I was
> successful using command line curl the following way: basically it's a
popup
> box with username and password. curl - u username:password
> http://proctected-url
>
> but in perl as a simple test, I get a 401 Unauthorized

If you set CURLOPT_VERBOSE true you'll get to see what headers libcurl sends
away, compare them to the ones the command line tool uses (with -v). Can you
see any differences?

Also, what libcurl version is this?

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
Received on 2003-10-22