cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: https authentication

From: Doug McNutt <douglist_at_macnauchtan.com>
Date: Sat, 21 Oct 2006 14:56:16 -0600

At 15:44 -0400 10/21/06, Rob Notwicz wrote:
>I'm using libcurl with PHP and I need to get at an https page behind a login. I have the username and password, but how do I make the connection and pull the page contents into a variable?

Start by observing the HTTP headers that are sent out when you log in with a browser.

The LiveHTTPheaders add-in for Firefox works for that or, if you happen to be using a Mac, the log file produced by iCab is perhaps better. Ethernet sniffers will leave you on the wrong side of the encryption.

If it's some paranoid bank you'll probably have a few passes of downloads and replies with cookies and repeated stuff in POSTs or GETs. Curl can save headers in a temp file and you can create copies of what you find for delivery with curl's -d option. I have some canned perl scripts for that but nothing in PHP.

-- 
-->  Halloween  == Oct 31 == Dec 25 == Christmas  <--
Received on 2006-10-21