I've been using php, including fopen(), completely in ssl without a problem. I don't know your web server, but in a default apache installation, the SSL directories are treated as a virtual host. the pages reached by https can be different from the directories for http. The problem could be either a web config problem or a file permissions problem.