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封装

相关推荐
开开心心_Every9 分钟前
支持自定义名单的实用随机抽签工具
运维·服务器·pdf·电脑·excel·启发式算法·宽度优先
Harm灬小海11 分钟前
【云计算学习之路】企业常用服务搭建:构建Apache WEB服务器
运维·服务器·学习·云计算·apache
AI云原生21 分钟前
远程控制软件进入协作阶段:ToDesk、向日葵、AnyDesk、RustDesk怎么选?
运维·服务器·网络·windows·docker·云原生·开源软件
java1234_小锋23 分钟前
Spring Boot 的嵌入式服务器(如 Tomcat)是如何启动的?如何替换为 Jetty 或 Undertow?
服务器·spring boot·tomcat
Re_Virtual8 小时前
centos 7环境下构建nginx 1.30
nginx·centos·rpmbuild
小辰记事本9 小时前
从零读懂RoCEv2数据包构造:从WQE到线缆上的完整旅程
服务器·网络·网络协议·rdma
江公望12 小时前
Ubuntu htop命令,10分钟讲清楚
linux·服务器
哎呦,帅小伙哦12 小时前
Linux 时间:从原子钟到 clock_gettime 的每一面
linux·运维·服务器
张小姐的猫13 小时前
【Linux】多线程 —— 线程互斥
linux·运维·服务器·c++
YuanDaima204813 小时前
Linux 进阶运维与 AI 环境实战:进程管理、网络排错与 GPU 监控
linux·运维·服务器·网络·人工智能