|
 siriy_sergei - 2005-07-17 12:22:12
Hi,
I need to login in admin side of site via SSL (Plesk admin side)
Here is a code I am using:
require("http.php");
set_time_limit(0);
$http=new http_class;
$http->timeout=0;
$http->data_timeout=0;
$http->debug=1;
$http->html_debug=1;
$http->follow_redirect=1;
$http->user_agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
$url="https://server.com:8443/login_up.php3";
$error=$http->GetRequestArguments($url,$arguments);
$arguments["RequestMethod"]="POST";
$arguments["PostValues"]=array(
"login_name" => "login",
"passwd" => "password"
);
$error=$http->Open($arguments);
if($error) die($error);
$error=$http->SendRequest($arguments);
if($error) die($error);
$headers=array();
$error=$http->ReadReplyHeaders(&$headers);
if($error) die($error);
Here is the script output:
Resolving HTTP server domain "server.com"...
Connecting to HTTP server IP 192.168.1.2...
Connected to server.com
C POST /login_up.php3 HTTP/1.1
C Host: server.com:8443
C User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
C Content-Type: application/x-www-form-urlencoded
C Content-Length: 32
C
C login_name=login&passwd=password
it was not possible to send data to the HTTP server
Thanks,
Siriy Sergei
 Manuel Lemos - 2005-07-17 18:24:29 - In reply to message 1 from siriy_sergei
This is hard to tell. It seems that there is a protocol error may be due to a problem in your PHP setup, as it is only failing after connection.
You may want to try setting track_errors on in php.ini and change the lines 204 and 215 where it says:
$this->SetDataAccessError("it was not possible to send data to the HTTP server");
to
$this->SetDataAccessError("it was not possible to send data to the HTTP server: ".$php_errormsg);
That should make the class return a more explicit error. Just let me know what it shows now.
 siriy_sergei - 2005-07-17 19:56:28 - In reply to message 2 from Manuel Lemos
Hi Manuel.
Thanks for your time and help.
I did all that you said, but I don't get any error reports from $php_errormsg variable.
This massege is output from FlushData() function. I use the PHP Version 5.0.0 with OpenSSL 0.9.7c
Do you have some ideas?
Thanks,
siriy Sergei.
 Manuel Lemos - 2005-07-17 21:57:06 - In reply to message 3 from siriy_sergei
That is very likely to be a bug in the PHP version that you are using. Can you try PHP 5.0.4?
If that does not help I will need to access a site like yours to reproduce the problem.
 siriy_sergei - 2005-07-18 07:31:20 - In reply to message 1 from siriy_sergei
Ok, thanks.
I'll do this and contact with you.
Thanks,
Siriy Sergei.
 siriy_sergei - 2005-07-18 20:29:28 - In reply to message 4 from Manuel Lemos
I tested script on 2 other servers with Apache & PHP 4.X. and script work only in one server. I'll try to find valid php.ini configuration for work your script.
 Manuel Lemos - 2005-07-29 01:29:48 - In reply to message 6 from siriy_sergei
Ok, just let me know when you have a server that I can use to reproduce the problem.
 Tayyab - 2006-02-03 09:22:15 - In reply to message 7 from Manuel Lemos
I got this output while posting to https website :
"establishing SSL connections requires the OpenSSL extension enabled"
what does I have to do to solve this problem. If I have to install any SSL ... how can I do it. Thanks in advance for your advice.
 Manuel Lemos - 2006-02-04 01:40:52 - In reply to message 8 from Tayyab
You need to compile PHP with the Curl extension enabled or at least PHP 4.3 with the OpenSSL support.
 Jose E. Curiel - 2006-08-14 23:58:45 - In reply to message 1 from siriy_sergei
I am trying to send a xml to a https page wich requires authorization. I used your httpclient but only get the login page.
By modifying the test_http.php:
-I uncomment the require(sals.php), fill the user and password fields, specify the https in the url.
-I also did a small program to open a socket with port 443, I can connect but get only several blank lines (<br>) and the text 'null' from the site.
This is part of the messages (hope you can help):
+++++++++++++++
06:54:54 Opening connection to:
www.centrodemensajeria.movistar.com.mx
Connecting to www.centrodemensajeria.movistar.com.mx
Sending request for page:
/envioSMS/SME.jsp
Login: +++++++++
Password: *********
C GET /envioSMS/SME.jsp HTTP/1.0
Host: www.centrodemensajeria.movistar.com.mx
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Pragma: nocache
Request:
GET /envioSMS/SME.jsp HTTP/1.0
Request headers:
Host: www.centrodemensajeria.movistar.com.mx
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Pragma: nocache
S HTTP/1.0 200 OK
S Date: Mon, 14 Aug 2006 23:54:52 GMT
S Server: Apache Coyote/1.0
S Set-Cookie: JSESSIONID=EBECD6CF56EDEEAAA22800D9A2C41C85; Path=/envioSMS
S Content-Type: text/html;charset=ISO-8859-1
S Connection: close
S
Response status code:
200
Response headers:
http/1.0 200 ok:
date: Mon, 14 Aug 2006 23:54:52 GMT
server: Apache Coyote/1.0
set-cookie: JSESSIONID=EBECD6CF56EDEEAAA22800D9A2C41C85; Path=/envioSMS
content-type: text/html;charset=ISO-8859-1
connection: close
Response body:
+++++++++
|