Skip to content

Commit

Permalink
Merge pull request #39 from rabbitmq/tls-gen-35
Browse files Browse the repository at this point in the history
Make Issuer CN more unique
  • Loading branch information
lukebakken authored Mar 15, 2022
2 parents 0f68adf + 0a87bc3 commit 6839b76
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tls_gen/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import stat
import tempfile

from datetime import datetime
from os import path
from subprocess import run

Expand Down Expand Up @@ -109,13 +110,14 @@ def prepare_ca_directory(dir_name):

def generate_root_ca(opts):
prepare_ca_directory(root_ca_path())
iso_date = datetime.now().isoformat()
args = ["-x509",
"-days", str(opts.validity_days),
"-newkey", "rsa:{}".format(opts.key_bits),
"-keyout", root_ca_key_path(),
"-out", root_ca_certificate_path(),
"-outform", "PEM",
"-subj", "/CN=TLSGenSelfSignedtRootCA/L=$$$$/"]
"-subj", "/CN=TLSGenSelfSignedtRootCA {}/L=$$$$/".format(iso_date)]
if len(opts.password) > 0:
args.append("-passout")
args.append("pass:{}".format(opts.password))
Expand Down

0 comments on commit 6839b76

Please sign in to comment.