I am having a problem with cURL - I cannot login via https. This is what I have:
Upon logging into the site normally via browser, it automatically redirects you to default.aspx page, so it should be the same with cURL. However, with cURL I get the page (actually it's the same login.aspx page) which is displayed if user's session time expires (that is, if logged in user has been inactive for 20 mins or so) or if a restricted page is being accessed without authorization. It doesn't display incorrect username/password message, so it seems the server checks them and accepts them but still doesn't log in properly. If I put incorrect username/password intentionally in $data_pack, I DO get the incorrect username/password message.PHP Code:$curl = &new cURLManager('https://foobar.com/login.aspx');
$curl->setOption(CURLOPT_HEADER, false);
$curl->setOption(CURLOPT_POST, true);
$curl->setOption(CURLOPT_POSTFIELDS, $data_pack); //string of vars (username=foo&password=bar etc)
$curl->setOption(CURLOPT_RETURNTRANSFER, true);
$curl->setOption(CURLOPT_SSL_VERIFYPEER, false); //Temporarily used to remove the SSL error
$curl->setOption(CURLOPT_SSL_VERIFYHOST, false); //Temporarily used to remove the SSL error
$curl->setOption(CURLOPT_FOLLOWLOCATION, true);
$curl->setOption(CURLOPT_REFERER, 'http://www.foobar2.com');
$curl->setOption(CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
$data = $curl->getOutput();
What do you think could be the problem of this login? Maybe I need to set other options in cURL? HTTPS is something I am messing with for the first time, so ANY help/suggestions would be greatly appreciated.




// 
Bookmarks