I'm running PHP 4.3.3 compiled with --with-openssl against Red Hat 8.0's latest openssl libraries (patched versions of 0.9.6) and am having some strange issues using fopen() fread(), etc...
Here's my code briefly...
function echo_test() {
/* Set up our context options */
$opts = array(
'ssl' => array(
'allow_self_signed' => "TRUE"
)
);
$context = stream_context_create($opts);
$handle = fopen("https://www.secureurl.org/", "r", FALSE, $context);
while (TRUE) {
$data = fread($handle, 1024);
if (strlen($data) == 0) {
break;
}
$stuff .= stripslashes($data);
}
fclose($handle);
return $stuff;
}
When I run this function I get the following error:
Warning: fread(): SSL: fatal protocol error in /WWW/inc/ECHO.php on line 23
However, the page loads up the data correctly that was on the site, and I can see in my SSL logs that a request was successfully made. So it appears things are working, and in fact working well enough that I can work with the data received... but what is this error messge? It bugs me! Obviously I can "hide" the error messages, but usually error messages only appear if something is going wrong...
Any suggestions? Additional context information? I'm not sure if I need to be referenceing certs on my local server when I make requests to other servers...
Thanks.