rabbitmq / tls-gen

Generates self-signed x509/TLS/SSL certificates useful for development
Mozilla Public License 2.0
368 stars 103 forks source link

make clean CN=<common_name> ignores the specification of the common name in the command line #59

Closed tilman67 closed 8 months ago

tilman67 commented 9 months ago

Describe the bug

Just a minor issue, however: When certificates are created with the CN=<common_name> variable to override the default common name, then

make clean CN=<common_name>

assumes the default common name instead of <common_name>. As a consequence, the directories client_<common_name> and server_<common_name> are not deleted.

I already figured out myself that the problem is in common.mk lines 56 and 57:

clean:
    $(PYTHON) profile.py clean

The clean target is missing the --common-name '$(CN)' option which is present in other targets. After I added the option like

clean:
    $(PYTHON) profile.py clean --common-name '$(CN)'

everything worked fine.

Reproduction steps

  1. git clone https://github.com/rabbitmq/tls-gen tls-gen
  2. cd tls-gen/basic
  3. make CN="foobar"
  4. make clean CN="foobar"

Expected behavior

The following directories are deleted:

client_foobar
server_foobar

Additional context

No response

michaelklishin commented 9 months ago

@tilman67 please submit a PR. Thank you.

lukebakken commented 9 months ago

@tilman67 good catch! Please submit a PR as @michaelklishin asked. Thanks!