#23220 [Com]: fgets() causes warning while reading data via SSL channel (HTTPS)

From: Date: Mon, 03 May 2004 15:56:03 +0000
Subject: #23220 [Com]: fgets() causes warning while reading data via SSL channel (HTTPS)
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969360443@lists.php.net to get a copy of this message
ID: 23220 Comment by: grizu1 at gmx dot info Reported By: storozhilov at mail dot ru Status: Closed Bug Type: Documentation problem Operating System: * PHP Version: 4CVS New Comment: Hi, this bug still exists on php4-STABLE-200405031430. ;-( System: - Linux (RedHat 8) 2.4.20-28.8 #1 Thu Dec 18 12:53:39 EST 2003 i686 i686 i386 GNU/Linux - php4-STABLE-200405031430 - OpenSSL 0.9.6b Configure command: './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--with-openssl' '--with-sapdb=/opt/sapdb/interfaces/odbc/' php-script: <?php $url = "https://foo.bar"; file_get_contents($url); ?> Output: Warning: file_get_contents(): SSL: fatal protocol error in /www/www.default.de/html/https2.php on line 3 Any help for me? Greetings grizu Previous Comments: ------------------------------------------------------------------------ [2004-04-30 15:03:05] obercik at poczta dot onet dot pl PHP Version 5.0.0RC2 Configure Command './configure' '--with-openssl' ... if ( $fp = fopen("https://xxxxxxxx, "r") ) { while ( $row = fgets($fp, 1024) ) { print($row); } fclose($fp); } Warning: fgets() [function.fgets]: SSL: fatal protocol error in xxxxxxxxxxxxxxxxxxx.php on line xx however it GETS the data... ------------------------------------------------------------------------ [2004-04-30 06:24:55] mike dot davsi at temple dot edu I'm seeing this against an apache server. What version is this fixed in? file_get_contents("https://....."); PHP 4.3.2 (cgi), Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies I have fixed it for now with error_reporting but would like to get a true fix. ------------------------------------------------------------------------ [2004-02-19 11:00:45] nlopess@php.net This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. ------------------------------------------------------------------------ [2004-02-18 19:12:00] iliaa@php.net Marking as documentation problem. Some (IIS) non-standard compliant servers send data in a way that causes PHP to raise warnings. When working with such servers you should lower your error_reporting level not to include warnings. ------------------------------------------------------------------------ [2004-02-16 20:16:59] scottmacvicar at ntlworld dot com Since this indeed an error but it will happen anytime you make an HTTPS request to IIS i think the error should be changed to E_NOTICE and the error message updated to what it actually does. Patch --- diff -u network.c network.c.patched --- network.c 2004-02-17 01:20:49.000000000 +0000 +++ network.c.patched 2004-02-17 01:22:23.000000000 +0000 @@ -870,8 +870,8 @@ case SSL_ERROR_SYSCALL: if (ERR_peek_error() == 0) { if (nr_bytes == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "SSL: fatal protocol error"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, + "SSL: EOF occurred in violation of protocol"); stream->eof = 1; retry = 0; } else { ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/23220 -- Edit this bug report at http://bugs.php.net/?id=23220&edit=1

« previous php.doc (#969360443) next »