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

相关推荐
吠品3 小时前
免费SSL证书自动化申请:DNS代理验证
网络协议·自动化·ssl
qq_401700413 小时前
嵌入式用Unix时间的优势及其C语言转换
服务器·c语言·unix
xu_yule5 小时前
Linux_12(进程信号)内核态和用户态+处理信号+不可重入函数+volatile
linux·运维·服务器
虾..6 小时前
Linux 环境变量&&进程优先级
linux·运维·服务器
zhuyasen7 小时前
Go Web 开发利器:如何让你的 Gin 服务拥有 Nginx 般的静态文件处理能力?
nginx·go·gin
achi0107 小时前
Ubuntu 24.04 LTS 下 Vue 3 开发环境搭建与生产部署完整指南
nginx·node·nvm·vue 3·ubuntu 24·开发环境搭建·国内镜像仓库
郝学胜-神的一滴8 小时前
Linux命名管道:创建与原理详解
linux·运维·服务器·开发语言·c++·程序人生·个人开发
宾有为8 小时前
【Linux】Linux 常用指令
linux·服务器·ssh
wanhengidc9 小时前
云手机性能如何?
运维·服务器·科技·智能手机·云计算
ajassi20009 小时前
开源 Linux 服务器与中间件(十三)FRP服务器、客户端安装和测试
linux·服务器·开源