Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 0832165c43cc059ca2d8de0bef09990f6ebdcae0 authored by cvs2svn on 18 March 2002, 16:47:35 UTC
This commit was manufactured by cvs2svn to create tag 'r221c1'.
Tip revision: 0832165
test_socket_ssl.py
# Test just the SSL support in the socket module, in a moderately bogus way.

import test_support

# Optionally test SSL support.  This currently requires the 'network' resource
# as given on the regrtest command line.  If not available, nothing after this
# line will be executed.
test_support.requires('network')

import socket
if not hasattr(socket, "ssl"):
    raise test_support.TestSkipped("socket module has no ssl support")

import urllib

socket.RAND_status()
try:
    socket.RAND_egd(1)
except TypeError:
    pass
else:
    print "didn't raise TypeError"
socket.RAND_add("this is a random string", 75.0)

f = urllib.urlopen('https://sf.net')
buf = f.read()
f.close()
back to top