aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--netlib/tcp.py4
-rw-r--r--test/test_tcp.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py
index a79f3ac4..40bd4bde 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -185,7 +185,7 @@ class TCPClient:
"""
context = SSL.Context(method)
if options is not None:
- ctx.set_options(options)
+ context.set_options(options)
if clientcert:
try:
context.use_privatekey_file(clientcert)
@@ -220,7 +220,7 @@ class TCPClient:
self.connection.settimeout(n)
def gettimeout(self):
- self.connection.gettimeout()
+ return self.connection.gettimeout()
def close(self):
"""
diff --git a/test/test_tcp.py b/test/test_tcp.py
index e7524fdc..6ff42072 100644
--- a/test/test_tcp.py
+++ b/test/test_tcp.py
@@ -90,7 +90,7 @@ class TestServerSSL(test.ServerTestBase):
def test_echo(self):
c = tcp.TCPClient("127.0.0.1", self.port)
c.connect()
- c.convert_to_ssl(sni="foo.com")
+ c.convert_to_ssl(sni="foo.com", options=tcp.OP_ALL)
testval = "echo!\n"
c.wfile.write(testval)
c.wfile.flush()
@@ -193,6 +193,7 @@ class TestTimeOut(test.ServerTestBase):
c = tcp.TCPClient("127.0.0.1", self.port)
c.connect()
c.settimeout(0.1)
+ assert c.gettimeout() == 0.1
tutils.raises(tcp.NetLibTimeout, c.rfile.read, 10)