Ecc:

openssl ecparam -out EccCA.key -name prime256v1 -genkey

openssl req -x509 -out 134.175.156.78.crt -keyout 134.175.156.78.key -newkey ec:EccCA.key -nodes -sha256 -days 3650 \
-subj '/CN=134.175.156.78' -extensions EXT -config <( \
printf "[dn]\nCN=134.175.156.78\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:134.175.156.78\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")


Rsa:

openssl req -x509 -out 134.175.156.78.crt -keyout 134.175.156.78.key -newkey rsa:2048 -nodes -sha256 -days 3650 \
-subj '/CN=134.175.156.78' -extensions EXT -config <( \
printf "[dn]\nCN=134.175.156.78\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:134.175.156.78\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")



里面IP改成自己的就是自己服务器的自签证书了。