cURL / Mailing Lists / curl-users / Single Mail

curl-users

440 Login Timeout

From: Javi Legido <javi_at_legido.com>
Date: Thu, 18 Dec 2008 15:15:08 +0100

Hi.

I want to connect to a https:// site from a machine inside a proxy. I
achieved it, but for a reason I don't understand, few minutes after
the same script fails with a '440 Login Timeout':

######################## Script #############################

<?php

include("config_proxy.php");

########################## https ###########################3

#$CONFIG['cUrl'] = 'https://my_url';

$CONFIG['cVariable'] = 'my_parameter';

$ch = curl_init();

# Pones la URL del login donde rellena el post

curl_setopt($ch, CURLOPT_URL, $CONFIG['cUrl']);

# Proxy

curl_setopt ($ch, CURLOPT_HEADER, 0);

curl_setopt($ch, CURLOPT_PROXY, $CONFIG_PROXY['Proxy']['Nombre_puerto']);

curl_setopt($ch, CURLOPT_PROXYUSERPWD,
$CONFIG_PROXY['Proxy']['Usuario_contrasenya']);

curl_setopt($ch,CURLOPT_USERPWD,$CONFIG_APACHE['Usuario_contrasenya']);

$fh = fopen('log.txt','w') or die($php_errormsg);

curl_setopt($ch, CURLOPT_VERBOSE,1);

curl_setopt($ch, CURLOPT_STDERR, $fh);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

curl_setopt($ch, CURLOPT_HEADER, 1);

curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.0)");

$usecookie = "cookie.txt";

if ($usecookie)

{

        curl_setopt($ch, CURLOPT_COOKIEJAR, $usecookie);

        curl_setopt($ch, CURLOPT_COOKIEFILE, $usecookie);

}

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

// Aquí pones las variables del POST

curl_setopt ($ch, CURLOPT_POSTFIELDS,$CONFIG['cVariable']);

$result =curl_exec ($ch);

echo "Contenido_1>".$result."<<br><br>";

curl_close ($ch);

?>

######################## log.txt ##########################

* About to connect() to proxy my_proxy port 8080 (#0)
* Trying ip_proxy... * connected
* Connected to my_proxy (ip_proxy) port 8080 (#0)
* Establish HTTP proxy tunnel to public_host:443
* Proxy auth using Basic with user 'proxy_user'
* Server auth using Basic with user ''
> CONNECT public_host:443 HTTP/1.0

Host: public_host:443

Proxy-Authorization: Basic YTcwNzkwMzphZ3VhY2E2OQ==

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Proxy-Connection: Keep-Alive

< HTTP/1.0 200 Connection established

<

* Proxy replied OK to CONNECT request
* successfully set certificate verify locations:
* CAfile: none
  CApath: /etc/ssl/certs
* SSL connection using RC4-MD5
* Server certificate:
* subject: private_data
* start date: 2008-11-19 00:00:00 GMT
* expire date: 2009-11-19 23:59:59 GMT
* issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign
International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by
Ref. LIABILITY LTD.(c)97 VeriSign
* SSL certificate verify ok.
* Server auth using Basic with user ''
> POST rest_of_url HTTP/1.1

Authorization: Basic Og==

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Host: public_host

Accept: */*

Content-Length: 206

Content-Type: application/x-www-form-urlencoded

< HTTP/1.1 440 Login Timeout

< Connection: Keep-Alive

< Content-Length: 154

< Content-Type: text/html

* Added cookie sessionid="" for domain public_host, path /, expire 0
< Set-Cookie: sessionid=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT

* Added cookie cadata="" for domain public_host, path /, expire 0
< Set-Cookie: cadata=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT

<

* Connection #0 to host my_proxy left intact
* Closing connection #0
* WARNING: failed to save cookies in cookie.txt

###########################################################

Any help?

Thanks

Javier
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-12-18