4

I would not like (or cannot) modify the default .cnf openssl config file.

How do tell the openssl command line tool to use a different .cnf file at another location - not the default?

1

1 Answer 1

6

You can override openssl configuration using one of the actions:

  • Set OPENSSL_CONF environment variable to point to your custom configuration file
  • Use -config option with the commands handling certificate (e.g. req, ca...)
  • Most of the definition in the openssl.cnf can be overridden using command line option.

You can also look at man x509v3_config.

Sign up to request clarification or add additional context in comments.

2 Comments

could you please post some samples of syntax putting parameters from config file to command line? openssl.cnf use cryptic syntax with dollar signs (never seen in windows world) and I cant found eny example of how to transcript to command line. For example what parameters are mandatory for what actions (req, ca, etc..)
@user2956477: You can use the subj parameter as follows: openssl req -new -sha256 -key keyFile.pem -out csrRequest.csrr -subj "/C=US/ST=OH/L=Cincinnati/O=Your Company, Inc./OU=IT/CN=yourdomain.com"