MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / testSslCert

Method testSslCert

src/Test/TestCryptConnection.py:8–23  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6
7class TestCryptConnection:
8 def testSslCert(self):
9 # Remove old certs
10 if os.path.isfile("%s/cert-rsa.pem" % config.data_dir):
11 os.unlink("%s/cert-rsa.pem" % config.data_dir)
12 if os.path.isfile("%s/key-rsa.pem" % config.data_dir):
13 os.unlink("%s/key-rsa.pem" % config.data_dir)
14
15 # Generate certs
16 CryptConnection.manager.loadCerts()
17
18 assert "tls-rsa" in CryptConnection.manager.crypt_supported
19 assert CryptConnection.manager.selectCrypt(["tls-rsa", "unknown"]) == "tls-rsa" # It should choose the known crypt
20
21 # Check openssl cert generation
22 assert os.path.isfile("%s/cert-rsa.pem" % config.data_dir)
23 assert os.path.isfile("%s/key-rsa.pem" % config.data_dir)

Callers

nothing calls this directly

Calls 2

loadCertsMethod · 0.80
selectCryptMethod · 0.80

Tested by

no test coverage detected