diff options
author | Facundo Batista <facundobatista@gmail.com> | 2007-04-22 01:18:56 (GMT) |
---|---|---|
committer | Facundo Batista <facundobatista@gmail.com> | 2007-04-22 01:18:56 (GMT) |
commit | 9f87128d8b6282e3c1afd2cd08150e5f5de14290 (patch) | |
tree | 4c076ae08d6296c4338d31a0847177fb548ab84f /Lib/test/test_socket_ssl.py | |
parent | 24522982d000b7a7b15cd474466ddea1fca9e69a (diff) | |
download | cpython-9f87128d8b6282e3c1afd2cd08150e5f5de14290.zip cpython-9f87128d8b6282e3c1afd2cd08150e5f5de14290.tar.gz cpython-9f87128d8b6282e3c1afd2cd08150e5f5de14290.tar.bz2 |
Added tests for other methods of SSL object. Now we cover
all the object methods. This is the final step to close
the #451607 bug.
Diffstat (limited to 'Lib/test/test_socket_ssl.py')
-rw-r--r-- | Lib/test/test_socket_ssl.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_socket_ssl.py b/Lib/test/test_socket_ssl.py index 7b5883a..aab2b75 100644 --- a/Lib/test/test_socket_ssl.py +++ b/Lib/test/test_socket_ssl.py @@ -117,6 +117,21 @@ class OpenSSLTests(unittest.TestCase): self.assertEqual(i, "Foo\n") s.close() + def testMethods(self): + # read & write is already tried in the Basic test + # now we'll try to get the server info about certificates + # this came from the certificate I used, one I found in /usr/share/openssl + info = "/C=PT/ST=Queensland/L=Lisboa/O=Neuronio, Lda./OU=Desenvolvimento/CN=brutus.neuronio.pt/emailAddress=sampo@iki.fi" + + s = socket.socket() + s.connect(("localhost", 4433)) + ss = socket.ssl(s) + cert = ss.server() + self.assertEqual(cert, info) + cert = ss.issuer() + self.assertEqual(cert, info) + s.close() + class OpenSSLServer(threading.Thread): def __init__(self): |