modified version of: http://s3.jspenguin.org/ssltest.py