cURL / Mailing Lists / curl-library / Single Mail


Can't get a page using HTTPS

From: Terry Stebbens <>
Date: Thu, 5 May 2005 13:45:25 +0100


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,
number>&body=<some text>");

When I run this I get the following from curl using the CURLOPT_VERBOSE

* About to connect() to port 8100
* Trying * connected
* Connected to ( 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/ Incorp. by
Ref.,LIAB.LTD(c)98/OU=Authenticated by KPN Telecom BV/OU=Member, VeriSign
Trust Network/
* start date: 2004-08-12 00:00:00 GMT
* expire date: 2005-08-12 23:59:59 GMT
* common name: (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
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=""
< 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.


Terry Stebens
Received on 2005-05-05