I haven't found where can I ask this question, but looks like it is the right place.
With following command I can generate self-signed certificate for Certification authority (CA):
$ openssl req -new -x509 -days 3650 -config ./openssl/ca.cnf -key ./dist/ca_key.pem -out ./dist/ca_cert.pem
You can see option -days that set end date. And if I check generated certificate I see that days option work:
$ openssl x509 -enddate -noout -in ./dist/ca_cert.pem
notAfter=Aug 23 11:29:57 2028 GMT
And in all places/tutorials people use days option too.
However how can I specify the same option in .cnf config?
I investigated a lot of articles but nothig seems to work (ca.cnf):
[ ca ]
default_ca = my_ca
default_days = 3650 # does not work
days = 3650 # does not work
[ my_ca ]
...
default_days = 3650 # does not work
days = 3650 # does not work
...
[ req ]
...
default_days = 3650 # does not work
days = 3650 # does not work
...
None of above works, if I do not use -days option:
$ openssl req -new -x509 -config ./openssl/ca.cnf -keyout ./dist/ca_key.pem -out ./dist/ca_cert.pem
$ openssl x509 -enddate -noout -in ./dist/ca_cert.pem
notAfter=Sep 25 11:38:48 2018 GMT
You can see that default 30 days had been used.
Where in .cnf config I must specify -days option?