Important
the Common Name (CN) of the servers should be different from that of the CA. Otherwise, things won't work on servers that use OpenSSL.
openssl genpkey -algorithm ed25519 > ca-key.pem
openssl req -x509 -new -sha512 -days 365250 -subj '/CN=ca' -key ca-key.pem -out ca-cert.pem
openssl genpkey -algorithm ed25519 > server-key.pem
openssl req -new -sha512 -subj '/CN=server' -key server-key.pem -out server-csr.pem
openssl x509 -days 365250 -req -in server-csr.pem -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem
Add this option to the last command (openssl x509
)
to set the SAN of the server:
-extfile <(printf "subjectAltName=my.san.com")
For an IP SAN use this:
-extfile <(printf "subjectAltName=IP:1.2.3.4")
openssl verify -verbose -CAfile ca-cert.pem server-cert.pem