curl-library
Re: Can't get a page using HTTPS
Date: Thu, 5 May 2005 16:04:34 +0100
Well, I tried making the request without the user:pwd and then with it
after I got the WWW-Authenticate header but I still got the same response.
I think I may try seeing what my browser is sending/receiving and compare
that to what libcurl is sending and receiving and see if I can work it out
from there.
Cheers,
Terry Stebbens.
> Did you try simply repeating the page send??
>
> I've had a situation before where the server didn't accept the
> user:pwd until *after* it had sent out the WWW-Authenticate header. I
> had to hit the page without the userpwd, then repeat with the userpwd.
>
> Ralph Mitchell
>
>
> On 5/5/05, Terry Stebbens <STEBBENS_at_uk.ibm.com> wrote:
>
> >
> > Hi.
> >
> > I am trying to use a web-based SMS service that requires HTTPS. I have
the
> > following code:
> >
> > CURL *curlHandle = curl_easy_init();
> > curl_easy_setopt(curlHandle, CURLOPT_USERPWD, "<user>:<password>");
> > curl_easy_setopt(curlHandle, CURLOPT_HTTPAUTH, CURLAUTH_ANYSAFE);
> > curl_easy_setopt(curlHandle, CURLOPT_USERAGENT,
"libcurl-agent/7.13.2");
> > curl_easy_setopt(curlHandle, CURLOPT_URL,
> > "https://sms-1.quinsy.net:8100/callfact.asp?numbers=<some
> > number>&body=<some text>");
> > curl_easy_perform(curlHandle);
> >
> > When I run this I get the following from curl using the CURLOPT_VERBOSE
> > option:
> >
> > * About to connect() to sms-1.quinsy.net port 8100
> > * Trying 195.86.90.72... * connected
> > * Connected to sms-1.quinsy.net (195.86.90.72) port 8100
> > * successfully set certificate verify locations:
> > * CAfile: /home/dtuser/mc/share/curl/curl-ca-bundle.crt
> > CApath: none
> > * SSL connection using RC4-MD5
> > * Server certificate:
> > * subject: /C=NL/ST=Zuid Holland/L=Zoetermeer/O=Quinsy
BV/OU=Quinsy
> > BV/OU=certificaat.kpn.com/RPA Incorp. by
> > Ref.,LIAB.LTD(c)98/OU=Authenticated by KPN Telecom BV/OU=Member,
VeriSign
> > Trust Network/CN=sms-1.quinsy.net
> > * start date: 2004-08-12 00:00:00 GMT
> > * expire date: 2005-08-12 23:59:59 GMT
> > * common name: sms-1.quinsy.net (matched)
> > * issuer: /C=US/O=RSA Data Security, Inc./OU=Secure Server
> > Certification Authority
> > * SSL certificate verify ok.
> > > GET /callfact.asp?numbers=<some number>&body=<some text> HTTP/1.1
> > User-Agent: libcurl-agent/7.13.2
> > Host: sms-1.quinsy.net:8100
> > Pragma: no-cache
> > Accept: */*
> >
> > < HTTP/1.1 401 Access Denied
> > < Server: Microsoft-IIS/5.0
> > < Date: Thu, 05 May 2005 11:47:27 GMT
> > < WWW-Authenticate: Basic realm="sms-1.quinsy.net"
> > < Connection: close
> > < Content-Length: 4431
> > < Content-Type: text/html
> >
> > The actual web-page I receive is basically saying I cannot access the
> > resource. Obviously I put proper values in for <user>, <password>,
<some
> > number>, and <some text>.
> >
> > However, if I try the same URL (cut and paste it) in a web browser,
with
> > the same username and password, it works and I get back the response I
was
> > expecting. I can see that the server's certificate is being accepted by
> > curl okay but I don't know much about SSL at all really so any help
would
> > be appreciated.
> >
> > Cheers,
> >
> > Terry Stebens
> >
Received on 2005-05-05