自签名证书

📅 2026/7/3 10:20:56 👁️ 阅读次数 📝 编程学习
自签名证书

证书

生成私钥

openssl genrsa -out localhost.key 2048

生成自签名证书

openssl req -new -x509 -key localhost.key -out localhost.crt -days 365 \ -subj "/CN=localhost" \ -addext "subjectAltName=DNS:localhost,IP:127.0.0.1,IP:::1"