Joe Shaw added the comment:
>From some experimentation, closing the underlying socket isn't enough. You
>also need to close the SSL socket, so you'd need to do something like:
new_socket = socket.create_connection((host, port), timeout)
ssl_socket = ssl.wrap_socket(new_sock
New submission from Joe Shaw :
Start a non-SSL server on port 2525:
$ python -m smtpd -n -c DebuggingServer localhost:2525
In another terminal, fire up a python interpreter and run the following code:
>>> import smtplib
>>> s = smtplib.SMTP_SSL("localhost", 2525)