| |
|
|
|
cURL Mailing List Monthly Index Single Mail
curl-users Mailing List Archives
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
######################## 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,
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
$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)
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
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
* Added cookie cadata="" for domain public_host, path /, expire 0
<
* Connection #0 to host my_proxy left intact
###########################################################
Any help?
Thanks
Javier
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info