0b0741103e
If no timeout was specified in fsockopen, we passed in 0.0, which was then used as the actual timeout, meaning that while the socket opened, it almost always failed to open in ssl mode due to timeout, and then read garbage data from the socket. We also failed to pass in the specified timeout for non-ssl sockets, but there we did use the default timeout rather than 0.0. I've changed that to use the passed in timeout instead.