Use stream_context_get_options() for 5.2 support
Use a more descriptive SSL failure error
Test expired and revoked SSL certificates