
02.01.2009, 13:51
|
|
Познавший АНТИЧАТ
Регистрация: 16.11.2004
Сообщений: 1,257
Провел на форуме: 1331503
Репутация:
454
|
|
https:// на PHP
в ответах Гугла надыбал исходник.
PHP код:
<?php
error_reporting(E_ALL);
# working vars
//https://global.bigmir.net/auth
$host = 'global.bigmir.net';
$service_uri = '/auth';
$local_cert_path = './keys.pem';
$local_cert_passphrase = 'pass_to_access_keys';
$request_data = 'url=http://passport.bigmir.net/&rnd=&pid=2&login=user&pass=pass&auth_type=1&subm=1';
# array with the options to create stream context
$opts = Array();
# compose HTTP request header
$header = "Host: $host\\r\\n";
$header .= "User-Agent: PHP Script\\r\\n";
$header .= "Content-Type: text/xml\\r\\n";
$header .= "Content-Length: ".strlen($request_data)."\\r\\n";
$header .= "Connection: close";
# define context options for HTTP request (use 'http' index, NOT 'httpS')
$opts['http']['method'] = 'POST';
$opts['http']['header'] = $header;
$opts['http']['content'] = $request_data;
# define context options for SSL transport
$opts['ssl']['local_cert'] = $local_cert_path;
$opts['ssl']['passphrase'] = $local_cert_passphrase;
echo "<HR><PRE>";
print_r($opts);
echo "</PRE><HR>";
# create stream context
$context = stream_context_create($opts);
# POST request and get response
$filename = 'https://'.$host.$service_uri;
$content = file($filename, false, $context);
$response_data = implode('', $content);
echo "<PRE>$content</PRE>";
//echo "<PRE>$response_data</PRE>";
echo "<HR>";
?>
по идее должна быть выведена страница БМ о том что пароль неправильный, а выводится мегамассив и потом пусто <HR><PRE></PRE><HR>
другой хостинг вообще сообщал что file() должен иметь до 2 параметров, а я, видите ли, 3 втыкнул...
Последний раз редактировалось vvs777; 02.01.2009 в 13:55..
|
|
|