On Mon, Apr 20, 2009 at 1:17 PM, Martin Walsh <[email protected]> wrote:
> from subprocess import Popen, PIPE
>
> openssl_cmd = 'openssl s_client -ssl2 -connect somewebsitename:443'
> openssl = Popen(
> openssl_cmd, shell=True, stdout=PIPE, stderr=PIPE, stdin=PIPE
> )
> stdout, stderr = openssl.communicate('GET /')
>
> Alternatively, if you're using python 2.6 and above, it looks like you
> can do something similar with a few lines of code, and the ssl module
> from the standard lib ...
>
> # untested!
> import ssl
> try:
> cert = ssl.get_server_certificate(
> ('somewebsitename', 443), ssl.PROTOCOL_SSLv2
> )
> except ssl.SSLError, ex:
> # site may not support sslv2
> ...
>
> HTH,
> Marty
Thanks Marty; this does indeed help...it just also means I need to really
learn how subprocess works. ;) I wish I could claim to be using 2.6, but
unfortunately the most current version at work is Python 2.5.2...most boxes
here are even below, and I can't convince them to upgrade. Ah, well.
Thanks again though!
K
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor