[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Change method makeConnection to use self.input as-is, and add docstring.



commit 54846399504b326fa010a750d3d0c53126adf54f
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Thu Feb 28 04:09:25 2013 +0000

    Change method makeConnection to use self.input as-is, and add docstring.
---
 nettests/experimental/tls_handshake.py |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/nettests/experimental/tls_handshake.py b/nettests/experimental/tls_handshake.py
index af59227..322ec72 100644
--- a/nettests/experimental/tls_handshake.py
+++ b/nettests/experimental/tls_handshake.py
@@ -190,10 +190,24 @@ class TLSHandshakeTest(nettest.NetTestCase):
             return cert_chain
 
     def test_tlsv1_handshake(self):
-
-        def makeConnection(addr, port):
-            socket = self.buildSocket(addr)
+        """xxx fill me in"""
+
+        def makeConnection(host):
+            """
+            Create a socket to the host's IP address, then get the TLS/SSL context
+            method and ciphersuite list. Lastly, initiate a connection to the
+            host.
+
+            @param host: A tuple of the host IP and port, i.e. (addr, port).
+            @returns: A :class:`OpenSSL.SSL.Connection` object (or any Exception
+                      that was raised), and the :param:`host`.
+            """
+            addr, port = host
+            sckt = self.buildSocket(addr)
             context = self.getContext()
+            connection = SSL.Connection(context, sckt)
+            connection.connect(host)
+            return connection
 
             connection = SSL.Connection(context, socket)
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits