Does the OpenSSL req command have a OpenSSL configuration file equivalent to the ca command's new_certs_dir option? I'd like to establish a default directory for all Certificate Signing Requests ("CSRs") that are created using the req command.

  • This question makes no sense for me. As documented openssl req either outputs to the given file name or to stdout. If one does not provide an absolute file name it is relativ to the current working directory where openssl req is executed - similar to how other programs handle file names. Commented Jul 12, 2020 at 17:48
  • I don't want to have to remember to specify the location where the CSR file will be saved as part of the '-out' option or have to navigate to the directory where my CSRs are stored when using the 'req' option to create a new CSR. If I understand the 'ca' command's 'new_certs_dir' option correctly, it passes the path of the directory where all new certs created by the 'ca' command are saved. I want to know if that same functionality is available for the 'req' command. Commented Jul 12, 2020 at 18:11
  • This functionality is not there. And contrary to ca the req command creates exactly the files you gave on the command line so such functionality is not needed. I also don't understand why you cannot remember the directory but you can remember the name of the file. Anyway, just use an absolute path for these files or create a wrapper script around it where you hard code the path you want. Commented Jul 12, 2020 at 19:05
  • Perfect! Thanks, Steffen for the quick answer. The wrapper is a great idea. If you submit this as an answer I'll mark it as such. Commented Jul 12, 2020 at 19:23

1 Answer 1


Such functionality is not there - and it is not needed: contrary to ca the req command creates exactly the files as given on the command line. So the easiest way is to use absolute path with req and creating a wrapper script around it which sets the directory part for these absolute path based on your preference.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .