# Test just the SSL support in the socket module, in a moderately bogus way.
from test
import test_support
# Optionally test SSL support. This requires the 'network' resource as given
# on the regrtest command line.
skip_expected
= not (test_support
.is_resource_enabled('network') and
test_support
.requires('network')
print "didn't raise TypeError"
socket
.RAND_add("this is a random string", 75.0)
f
= urllib
.urlopen('https://sf.net')
def test_rude_shutdown():
# some random port to connect to
s
= socket
.socket(socket
.AF_INET
, socket
.SOCK_STREAM
)
s
= socket
.socket(socket
.AF_INET
, socket
.SOCK_STREAM
)
s
.connect(('localhost', PORT
))
raise test_support
.TestFailed
, \
'connecting to closed SSL socket failed'
thread
.start_new_thread(listener
, ())
if not hasattr(socket
, "ssl"):
raise test_support
.TestSkipped("socket module has no ssl support")
if __name__
== "__main__":