I tried to use openssl to sign cert request with my own CA. There are two options.
openssl x509
.openssl X509 -req -CA ca.crt -CAkey ca.pem -in bob.csr -out bob.crt -CAcreateserial`
Some posts say x509 is used to generate self-signed certificates.
But error occurs using openssl X509
:
unable to load certificate
6612:error:0906D06C:PEM routines:PEM_read_bio:no start
line:.\crypto\pem\pem_lib.c:701:Expecting: TRUSTED CERTIFICATE
openssl ca
:openssl ca -in bob.csr -out bob.crt -keyfile ca.key
It needs to config openssl.config beforehand. E.g., create dir ./demoCA
.
Please let me know which way is correct. If openssl x509
is correct, how to solve expecting trusted certificate
error? Very appreciate!