openssl生成nginx ssl证书的简单方法

root@172-17-218-79 \~\]# **mkdir cert** \[root@172-17-218-79 \~\]# **cd cert/** \[root@172-17-218-79 cert\]# **openssl genrsa -out server.key 1024** Generating RSA private key, 1024 bit long modulus (2 primes) ......+++++ .........................................+++++ e is 65537 (0x010001) \[root@172-17-218-79 cert\]# **openssl req -new -key server.key -out server.csr** You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) \[AU\]: State or Province Name (full name) \[Some-State\]: Locality Name (eg, city) \[\]: Organization Name (eg, company) \[Internet Widgits Pty Ltd\]: Organizational Unit Name (eg, section) \[\]: Common Name (e.g. server FQDN or YOUR name) \[\]:server Email Address \[\]: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password \[\]: An optional company name \[\]: \[root@172-17-218-79 cert\]# **openssl x509 -req -in server.csr -out server.crt -signkey server.key -days 9999** Signature ok subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = server Getting Private key \[root@172-17-218-79 cert\]# ll total 12 -rw-r--r-- 1 root root 818 Dec 6 15:29 **server.crt** -rw-r--r-- 1 root root 627 Dec 6 15:29 server.csr -rw------- 1 root root 887 Dec 6 15:28 **server.key** 思路: 1. 生成私钥 2. 生成请求文件 3. 签名+x509封装

相关推荐
WXDcsdn1 小时前
华为VRF技术基于三层交换机的应用实例
服务器·网络·华为
佬乔2 小时前
JWT-验证
java·服务器·前端
破刺不会编程2 小时前
系统的环境变量
linux·运维·服务器·windows
UFIT2 小时前
Nginx 核心功能笔记
运维·笔记·nginx
2302_799525742 小时前
【Linux】第十三章 访问Linux文件系统
linux·运维·服务器
磨叽的鱼2 小时前
Ubuntu实现远程文件传输
linux·服务器·ubuntu
白总Server3 小时前
智能座舱架构中芯片算力评估
linux·运维·服务器·开发语言·ai·架构·bash
jsons15 小时前
Cliosoft安装
linux·运维·服务器
后院那片海5 小时前
Nginx核心功能
linux·服务器·nginx
DO_Community5 小时前
企业出海降本:如何将应用从 AWS EC2 快速无缝迁移至DigitalOcean Droplet
服务器·aws·digitalocean