Something went wrong. Try again.
Forking what is left of ZeroNet and hopefully adding an AT Proto Frontend/Proxy
Something went wrong. Try again.
123456789101112131415161718192021222324import os
from Config import configfrom Crypt import CryptConnection
class TestCryptConnection: def testSslCert(self): # Remove old certs if os.path.isfile("%s/cert-rsa.pem" % config.data_dir): os.unlink("%s/cert-rsa.pem" % config.data_dir) if os.path.isfile("%s/key-rsa.pem" % config.data_dir): os.unlink("%s/key-rsa.pem" % config.data_dir)
# Generate certs CryptConnection.manager.loadCerts()
assert "tls-rsa" in CryptConnection.manager.crypt_supported assert CryptConnection.manager.selectCrypt(["tls-rsa", "unknown"]) == "tls-rsa" # It should choose the known crypt
# Check openssl cert generation assert os.path.isfile("%s/cert-rsa.pem" % config.data_dir) assert os.path.isfile("%s/key-rsa.pem" % config.data_dir)