changed key algorithm from rsa to ec
build-and-push / check-branch (push) Successful in 10s
build-and-push / build (amd64, linux/amd64) (push) Successful in 10m44s

This commit is contained in:
2026-08-16 19:04:46 +03:30
parent 320098dd76
commit 5098a5d510
3 changed files with 15 additions and 6 deletions
+9 -4
View File
@@ -33,7 +33,7 @@ class CertificateAuthority:
# -- setup ---------------------------------------------------------
def _generate_root_ca(self):
key = rsa.generate_private_key(public_exponent=65537, key_size=4096)
key = ec.generate_private_key(ec.SECP256R1())
subject = issuer = x509.Name(
[x509.NameAttribute(NameOID.COMMON_NAME, CA_COMMON_NAME)]
)
@@ -157,7 +157,7 @@ class CertificateAuthority:
if not hostnames:
raise ValueError("at least one hostname/IP is required")
key = rsa.generate_private_key(public_exponent=65537, key_size=2048)
key = ec.generate_private_key(ec.SECP256R1())
now = datetime.datetime.now(datetime.timezone.utc)
subject = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, hostnames[0])])
@@ -180,7 +180,12 @@ class CertificateAuthority:
.add_extension(
x509.KeyUsage(
digital_signature=True,
key_encipherment=True,
# key_encipherment only applies to RSA (key-transport)
# keys; it's meaningless for an ECDSA key and shouldn't
# be set here now that this is EC. ECDHE cipher suites
# use ephemeral keys for the actual exchange — this
# cert's key is only ever used to sign, not encipher.
key_encipherment=False,
content_commitment=False,
data_encipherment=False,
key_agreement=False,
@@ -256,4 +261,4 @@ class CertificateAuthority:
return False
return True
except Exception:
return False
return False