I am trying to add custom extensions to my self-signed certificate. I tried the following
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -extfile myconfig.cnf -extensions v3_req
Error is
unknown option -extfile
myconfig.cnf
[req]
req_extensions = v3_req
[v3_req]
1.2.3.4.5.6.7.8=ASN1:UTF8String:Something
when I remove -extfile myconfig.cnf -extensions v3_req
, I see cert.pem created successfully.
I do see -extfile is not a valid option. However, I see other posts suggesting the same Openssl Custom Extension
EDIT
I used -config
instead of -extfile
but I get the following error
unable to find 'distinguished_name' in config
problems making Certificate Request
4646921836:error:0EFFF06C:configuration file routines:CRYPTO_internal:no value:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.260.1/libressl-2.6/crypto/conf/conf_lib.c:322:group=req name=distinguished_name