SSL Sockets in Windows
Syver Enstad
syver-en+usenet at online.no
Sat Dec 29 10:03:16 EST 2001
Gerhard Häring <gh_pythonlist at gmx.de> writes:
> Le 28/12/01 à 07:18, Syver Enstad écrivit:
> >
> > Hi Al, I'm not exactly an expert on SSL :-). I know it's what goes
> on
>
> > behind the scenes when my browser uses an https url and
> communication
>
> > is encrypted and whatnot.
> >
> > Do you have (or can you refer me to) a quick
> > example to check that SSL is indeed working on Python?
>
> You can check pretty easily if your Python is compiled with SSL
> support:
>
>
> 'ssl' in dir(socket)
Yes, returns true (1)
> If so, you should be able to fetch a HTML page with the urllib module:
>
>
> print urllib.urlopen("https://www.sf.net/").read()
Yes, this fetches the front page of sourceforge, which says that I'm
not logged in.
What would happen if I didn't have SSL installed.
You see I compiled up a new version of _socket.pyd with VC++ 6 and
this time I specified that SSL shouldn't be compiled in. 'ssl' in
dir(socket) still returns true, and the download goes without a
hitch too. I haven't checked with a packet sniffer though.
> reduce(lambda x,y:x+y,map(lambda
> x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
Cute, and true.
--
Vennlig hilsen
Syver Enstad
More information about the Python-list
mailing list