For example,
openssl x509 \
-req -sha256 \
-days "365" \
-CAcreateserial \
-CA "ca.crt" -CAkey "ca.key" -passin "pass:abcd" \
-in "csr.csr" -extfile "ext.ext" \
-out "c.crt";
It also creates a file ca.srl which contains signed certificate's serial.
The above won't work if -CAcreateserial argument is absent and outputs an error:
/test/ca.srl: No such file or directory
140413509251520:error:06067099:digital envelope routines:EVP_PKEY_copy_parameters:different parameters:../crypto/evp/p_lib.c:93:
140413509251520:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:72:fopen('/test/ca.srl','r')
140413509251520:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:79:
Isn't that argument used to output a file with a serial which is possible to get via a command below anyways?
openssl x509 \
-in "c.crt" \
-noout \
-serial;
What's the point? Why does it not create the file internally if required, but saves it on a storage?