I deployed my D5 site from my dev machine (Arch Linux with PHP 5.2.9) to the test server (Debian Etch with PHP 5.2.0-8+etch13). One custom module submits an XML-RPC request to a remote server via HTTPS. On the test server I got this error message:

Warning: fread() [function.fread]: SSL: fatal protocol error in /.../includes/common.inc on line 482

After googling around I found this PHP bug: http://bugs.php.net/bug.php?id=41770

To make the site work I had to apply a patch on the core.

I don't know if this ticket can be qualified as a "Drupal bug" since this is a PHP bug, and it is very hard to reproduce, but if anyone suffers from this problem then the patch can be helpful.

CommentFileSizeAuthor
#2 fread.patch363 bytesFogg
ssl_error_workaround-D5.diff328 bytestamasd

Comments

BMDan’s picture

Surely throwing around "@"'s willy-nilly can't be well-advised.

Fogg’s picture

Status: Active » Needs review
StatusFileSize
new363 bytes

Hi,
got the same issue here. Instead of using @ I increased the read-size.
This also solves the issue and seems to be more safe.
Fogg

drumm’s picture

Status: Needs review » Postponed (maintainer needs more info)

That PHP bug says it was fixed 2007-07-02. What version of PHP are you all running?

@Yorirou I see you have 5.2.9. Can you upgrade to at least 5.2.10?

tamasd’s picture

The PHP on the server is upgraded (5.2.6-1+lenny9), and I changed my distro since then (now I have PHP 5.3.2).

I haven't seen any sign of this bug since a year or so... maybe it is fixed with the server upgrade, however I can't confirm, we don't have that site on the test server anymore.

Fogg’s picture

well, I am on a centos 5.6 with PHP 5.1.6. may be that is the reason...

alexku’s picture

Fogg, thank you very much. Increasing read size fixed an issue for me with fb module

D6 is also affected by this

tr’s picture

Version: 5.9 » 6.x-dev

#6 indicates that this is still an issue with Drupal 6.x, and since 5.x is no longer supported I'm going to bump this up to the 6.x-dev queue. I don't know how to reproduce the error, so I can't test to see if it's also present in Drupal 7.x or Drupal 8.x.

mandreato’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

I had the same problem (see #1340016: fread() SSL: fatal protocol error in common.inc on line 551) with Drupal 6.22 / Ubercart 6.x-2.x-dev running on the following environment:
Apache/2.2.3 (Debian) mod_jk/1.2.18 mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch16 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8

Patch #2 worked for me too.

Status: Reviewed & tested by the community » Needs work
Issue tags: -ssl

The last submitted patch, fread.patch, failed testing.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.