[GH-ISSUE #304] mkcert silently overwrites CSR file #193

Open
opened 2026-02-25 22:32:50 +03:00 by kerem · 1 comment
Owner

Originally created by @rajiv on GitHub (Oct 27, 2020).
Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/304

running mkcert 1.4.2.

when using the -csr flag, mkcert silently replaces the CSR file www.example.com.pem with a file of the same name www.example.com.pem that contains the signed certificate. instead of this destructive behaviour, mkcert could exit with an error instead of overwriting.

  1. create a CSR file in an external system and place in the current directory
  2. name the CSR file www.example.com.pem
  3. run mkcert -csr www.example.com.pem
  4. the file www.example.com.pem is replaced with the signed cert, and the CSR is destroyed
Originally created by @rajiv on GitHub (Oct 27, 2020). Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/304 running mkcert 1.4.2. when using the `-csr` flag, mkcert silently replaces the CSR file `www.example.com.pem` with a file of the same name `www.example.com.pem` that contains the signed certificate. instead of this destructive behaviour, mkcert could exit with an error instead of overwriting. 1. create a CSR file in an external system and place in the current directory 1. name the CSR file `www.example.com.pem` 1. run `mkcert -csr www.example.com.pem` 1. the file `www.example.com.pem` is replaced with the signed cert, and the CSR is destroyed
Author
Owner

@FiloSottile commented on GitHub (Oct 28, 2020):

Ah, yeah we should not do that. I'll just add an error for trying to write to an existing file.

<!-- gh-comment-id:717613929 --> @FiloSottile commented on GitHub (Oct 28, 2020): Ah, yeah we should not do that. I'll just add an error for trying to write to an existing file.
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#193
No description provided.