openssl unable to pass -config and -signkey options in the same command

I am attempting to generate a self-signed certificate with my custom config file for openssl. However, the options -config and -signkey are generating errors as below when used in the same command.

command attempt 1:

openssl req -x509 -config my_ssl.cnf \ -in my_new.csr -signkey my_private_key.pem \ -out my_new_crt.pem -days 3650 -sha256 \ -extfile my_V3.ext

Error message:

req: Unrecognized flag signkey
req: Use -help for summary.

Command Attempt 2:

openssl x509 -req -config my_ssl.cnf \ -in my_new.csr -signkey my_private_key.pem \ -out my_new_crt.pem -days 3650 -sha256 \ -extfile my_V3.ext

Error Message:

x509: Unrecognized flag config
x509: Use -help for summary.

What is going wrong in the above commands? And how can I pass both the -config and -signkey options together in the same command?

1 Answer

Nothing - there's no -config option in x509 and no -signkey option for req.

man x509

man req

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like