晕,还是早上那个问题?
下面这个是手册上的~~~用ssl://流完成~~不需要理会证书密钥~~流会自动完成必要的连接~~~例子 2. Making a POST request to an https server<?php
/* Send POST request to https://secure.example.com/form_action.php
 * Include form elements named "foo" and "bar" with dummy values
 */$sock = fsockopen("ssl://secure.example.com", 443, $errno, $errstr, 30);
if (!$sock) die("$errstr ($errno)\n");$data = "foo=" . urlencode("Value for Foo") . "&bar=" . urlencode("Value for Bar");fwrite($sock, "POST /form_action.php HTTP/1.0\r\n");
fwrite($sock, "Host: secure.example.com\r\n");
fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n");
fwrite($sock, "Content-length: " . strlen($data) . "\r\n");
fwrite($sock, "Accept: */*\r\n");
fwrite($sock, "\r\n");
fwrite($sock, "$data\r\n");
fwrite($sock, "\r\n");$headers = "";
while ($str = trim(fgets($sock, 4096)))
  $headers .= "$str\n";echo "\n";$body = "";
while (!feof($sock))
  $body .= fgets($sock, 4096);fclose($sock);
?>