mkcert icon indicating copy to clipboard operation
mkcert copied to clipboard

mkcert silently overwrites CSR file

Open rajiv opened this issue 5 years ago • 1 comments

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

rajiv avatar Oct 27 '20 21:10 rajiv

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

FiloSottile avatar Oct 28 '20 00:10 FiloSottile