aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_certutils.py20
-rw-r--r--test/test_tcp.py38
2 files changed, 2 insertions, 56 deletions
diff --git a/test/test_certutils.py b/test/test_certutils.py
index e079ec40..50df36ae 100644
--- a/test/test_certutils.py
+++ b/test/test_certutils.py
@@ -1,5 +1,5 @@
import os
-from netlib import certutils, certffi
+from netlib import certutils
import tutils
# class TestDNTree:
@@ -92,24 +92,6 @@ class TestCertStore:
ret = ca1.get_cert("foo.com", [])
assert ret[0].serial == dc[0].serial
- def test_gen_pkey(self):
- try:
- with tutils.tmpdir() as d:
- ca1 = certutils.CertStore.from_store(
- os.path.join(
- d,
- "ca1"),
- "test")
- ca2 = certutils.CertStore.from_store(
- os.path.join(
- d,
- "ca2"),
- "test")
- cert = ca1.get_cert("foo.com", [])
- assert certffi.get_flags(ca2.gen_pkey(cert[0])) == 1
- finally:
- certffi.set_flags(ca2.default_privatekey, 0)
-
class TestDummyCert:
diff --git a/test/test_tcp.py b/test/test_tcp.py
index 52398ef3..8a3299b6 100644
--- a/test/test_tcp.py
+++ b/test/test_tcp.py
@@ -10,7 +10,7 @@ import mock
from OpenSSL import SSL
import OpenSSL
-from netlib import tcp, certutils, certffi
+from netlib import tcp, certutils
from . import tutils, tservers
@@ -566,42 +566,6 @@ class TestDHParams(tservers.ServerTestBase):
assert os.path.exists(filename)
-class TestPrivkeyGen(tservers.ServerTestBase):
-
- class handler(tcp.BaseHandler):
-
- def handle(self):
- with tutils.tmpdir() as d:
- ca1 = certutils.CertStore.from_store(d, "test2")
- ca2 = certutils.CertStore.from_store(d, "test3")
- cert, _, _ = ca1.get_cert("foo.com", [])
- key = ca2.gen_pkey(cert)
- self.convert_to_ssl(cert, key)
-
- def test_privkey(self):
- c = tcp.TCPClient(("127.0.0.1", self.port))
- c.connect()
- tutils.raises("bad record mac", c.convert_to_ssl)
-
-
-class TestPrivkeyGenNoFlags(tservers.ServerTestBase):
-
- class handler(tcp.BaseHandler):
-
- def handle(self):
- with tutils.tmpdir() as d:
- ca1 = certutils.CertStore.from_store(d, "test2")
- ca2 = certutils.CertStore.from_store(d, "test3")
- cert, _, _ = ca1.get_cert("foo.com", [])
- certffi.set_flags(ca2.default_privatekey, 0)
- self.convert_to_ssl(cert, ca2.default_privatekey)
-
- def test_privkey(self):
- c = tcp.TCPClient(("127.0.0.1", self.port))
- c.connect()
- tutils.raises("sslv3 alert handshake failure", c.convert_to_ssl)
-
-
class TestTCPClient:
def test_conerr(self):