[GH-ISSUE #72] customise key and cert names #38

Closed
opened 2026-02-25 22:32:26 +03:00 by kerem · 6 comments
Owner

Originally created by @kishaningithub on GitHub (Aug 30, 2018).
Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/72

Ability to customise the names of output key and cert files would be a great usability feature

I suggest flags like

  • --o-key-file
  • --o-cert-file

So

mkcert example.com '*.example.org' myapp.dev localhost 127.0.0.1 ::1  --o-key-file my-cert.pem  --o-cert-file my-key.pem

would generate my-cert.pem and my-key.pem instead of the random looking ./example.com+5.pem ./example.com+5-key.pem

Originally created by @kishaningithub on GitHub (Aug 30, 2018). Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/72 Ability to customise the names of output key and cert files would be a great usability feature I suggest flags like - `--o-key-file` - `--o-cert-file` So ``` mkcert example.com '*.example.org' myapp.dev localhost 127.0.0.1 ::1 --o-key-file my-cert.pem --o-cert-file my-key.pem ``` would generate `my-cert.pem` and `my-key.pem` instead of the random looking `./example.com+5.pem` `./example.com+5-key.pem`
kerem closed this issue 2026-02-25 22:32:26 +03:00
Author
Owner

@liamdawson commented on GitHub (Oct 8, 2018):

Alternatively, maybe the openssl req syntax?

-out outfile        Output file
-keyout outfile     File to send the key to

Either way, the feature would be greatly appreciated! (I might look into doing it, but I know nothing about Golang yet)

<!-- gh-comment-id:427994705 --> @liamdawson commented on GitHub (Oct 8, 2018): Alternatively, maybe the `openssl req` syntax? ``` -out outfile Output file -keyout outfile File to send the key to ``` Either way, the feature would be greatly appreciated! (I might look into doing it, but I know nothing about Golang yet)
Author
Owner

@adamdecaf commented on GitHub (Oct 9, 2018):

I'd suggest avoiding adopting flag naming conventions from openssl.

--cert-file and --key-file ?

<!-- gh-comment-id:428246026 --> @adamdecaf commented on GitHub (Oct 9, 2018): I'd suggest avoiding adopting flag naming conventions from `openssl`. `--cert-file` and `--key-file` ?
Author
Owner

@sleagon commented on GitHub (Oct 10, 2018):

I just add a PR to fix this, #77 . Just notice that, you should put the params before arguments insead of after them.

This will not work.

mkcert example.com '*.example.org' myapp.dev localhost 127.0.0.1 ::1  --o-key-file my-cert.pem  --o-cert-file my-key.pem

This works.

mkcert --key-file my-cert.pem  --cert-file my-key.pem example.com '*.example.org' myapp.dev localhost 127.0.0.1 ::1
<!-- gh-comment-id:428561504 --> @sleagon commented on GitHub (Oct 10, 2018): I just add a PR to fix this, #77 . Just notice that, you should put the params before arguments insead of after them. **This will not work.** ```bash mkcert example.com '*.example.org' myapp.dev localhost 127.0.0.1 ::1 --o-key-file my-cert.pem --o-cert-file my-key.pem ``` **This works.** ```bash mkcert --key-file my-cert.pem --cert-file my-key.pem example.com '*.example.org' myapp.dev localhost 127.0.0.1 ::1 ```
Author
Owner

@sleagon commented on GitHub (Oct 10, 2018):

@kishaningithub @adamdecaf It will be nice if you guys could just try this PR.

<!-- gh-comment-id:428562288 --> @sleagon commented on GitHub (Oct 10, 2018): @kishaningithub @adamdecaf It will be nice if you guys could just try this PR.
Author
Owner

@FiloSottile commented on GitHub (Jan 6, 2019):

Not a fan of adding flags, but giving in to this after seeing scripts reimplement the naming logic to find the certificates after they are generated.

<!-- gh-comment-id:451785842 --> @FiloSottile commented on GitHub (Jan 6, 2019): Not a fan of adding flags, but giving in to this after seeing [scripts reimplement the naming logic to find the certificates after they are generated](https://github.com/Shopify/slate/wiki/4.-Create-a-self-signed-SSL-certificate).
Author
Owner

@FiloSottile commented on GitHub (Jan 7, 2019):

Fixed in #77

<!-- gh-comment-id:451788442 --> @FiloSottile commented on GitHub (Jan 7, 2019): Fixed in #77
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mkcert#38
No description provided.