From:             kurt at milliganshome dot net
Operating system: Linux
PHP version:      4.3.9
PHP Bug Type:     Network related
Bug description:  ssl over fopen vs fsockopen

Description:
------------
Hi All

Running php v4.3.9 on RH Linux 7.3 & 9.0 with openssl 0.9.7d.

I have noticed similar problems to Bug#23220, but have found that using
fopen works while using fsockopen does not.

// works ok!
$fd = fopen('https://www.somehost.com','r');
while(!feof($fd))
    echo fgets($fd,1024);

// generates SSL: fatal protocol error
$fd = fsockopen('ssl://www.somehost.com',443);
fwrite($fd,"GET / HTTP/1.1\r\nHost: www.somehost.com\r\nConnection:
Close\r\n\r\n");
while(!feof($fd))
    echo fgets($fd,1024);


This would be OK if I didn't need to POST, but I do...anyone else notice
this? Is there some difference in the way that fgets operates depending on
whether it was opened via fopen or fsockopen?

I see the posting in bug#23220:

"Note that due to the nature of the problem (eg: IIS being at fault),there
is no way for PHP to determine the difference between a legitimate problem
and a bogus IIS unless you are using the built-in HTTP wrapper: we inspect
the headers to determine if we should show the warning or not.

So, if you are manually opening an SSL stream, you still need to suppress
the warning yourself based on the presence of "Server: Microsoft-IIS" in
the headers that you read. "

But I don't get any headers back; the script fails on the first fgets
call. If I'm missing something, please let me know.

Thanks!


-- 
Edit bug report at http://bugs.php.net/?id=30765&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30765&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=30765&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=30765&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30765&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30765&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30765&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30765&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30765&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30765&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30765&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=30765&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=30765&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30765&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30765&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30765&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30765&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30765&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30765&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30765&r=mysqlcfg

Reply via email to