def setup_ca():
print('creating dummy CA')
if not CertificateAuthority.objects.exists():
ec = EthicsCommission.objects.get(uuid=settings.ETHICS_COMMISSION_UUID)
subject = '/CN={}/O={}'.format(settings.DOMAIN, ec.name[:64])
openssl.setup(subject)
if not os.path.exists(settings.ECS_CA_ROOT):
os.mkdir(settings.ECS_CA_ROOT)
ca_cert_path = os.path.join(settings.ECS_CA_ROOT, 'ca.cert.pem')
with open(ca_cert_path, 'w') as f:
ca = CertificateAuthority.objects.get()
f.write(ca.cert)
openssl.gen_crl()
评论列表
文章目录