生成私钥(key文件)
openssl genrsa -out client.key 4096
生成签名请求(csr文件)
openssl req -new -key client.key -out client.csr
签发证书
openssl x509 -req -days 36500 -in client.csr -signkey client.key -out client.crt
一键生成自签名证书
openssl req -new -x509 -newkey rsa:4096 -keyout test.key -out test.crt
crt证书转换为pem格式
openssl x509 -in test.crt -out test.pem
关于证书的理解:
public.pem:仅包含public证书
public.chain.crt:仅包含全部上级签发者public证书
public.crt:public.pem+public.chain.crt 组成,有先后顺序