先贴命令
openssl req -x509 -out localhost.crt -keyout localhost.key \ -newkey rsa:2048 -nodes -sha256 \ -subj '/CN=localhost' -extensions EXT -config <( \ printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
然后把文件复制到相关目录即可
localhost.key在/etc/pki/tls/private/目录下
localhost.crt在/etc/pki/tls/certs/目录下
就可以了
发表评论