хотелось бы небольшой пример, а то я где-то вычитал:
# working vars
$host = 'gusnet.lv';
$service_uri = '/pub/php/user.certificate.https/service_echo_post.php';
$local_cert_path = 'test-client.pem';
$local_cert_passphrase = 'TestPass';
$request_data = 'var1=value+of+var+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: application/x-www-form-urlencoded\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;
# 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);
,но у меня вылетает ошибка в строке $content = file($filename, false, $context);
типа
Warning: file(https://localhost/espp/ver1/user/test.php) [function.file]: failed to open stream: Invalid argument in C:\www\ESPP\ver1\user\request.php on line 54
Warning: implode() [function.implode]: Bad arguments. in C:\www\ESPP\ver1\user\request.php on line 56