I just wanted to note that as of php 4.3.3, there is a bug in the SSL-specific code for mechanisms like fread, fopen, and readfile. The symptom of this bug is an extra warning message upon attempting to read a file over https. The warning message indicates: "SSL: Fatal protocol error".
There is a patch which fixes this bug. For more details, please see: