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

相关推荐
EasyGBS8 小时前
摄像头还在线,画面已经不能用了?国标GB28181视频平台EasyGBS视频质量诊断怎么用
服务器·安全·音视频
程序员-Benothing8 小时前
Vim编辑器从入门到精通:模式、快捷键、配置、插件
linux·运维·服务器
wdfk_prog9 小时前
LWIP教程 09:从 `tcp_slowtmr()` 到 Fast Retransmit——TCP 超时重传与重复 ACK
服务器·网络·数据库·网络协议·tcp/ip
‎ദ്ദിᵔ.˛.ᵔ₎9 小时前
linux 进程信号 (上)
linux·服务器
迪康Defender9 小时前
终端安全审批体系设计:如何平衡安全管控与业务连续性
运维·服务器·安全·运维开发·学习方法·业界资讯·远程工作
liulilittle10 小时前
Linux 下 select 测试函数
linux·服务器·网络·数据库·c++·select·c
luo_guibin10 小时前
Linux系统下OpenSSL升级全流程,新旧版本切换
linux·运维·服务器
看着博客敲代码11 小时前
No space left on device:服务器被 SSH 爆破到日志写满的完整排查与止血
linux·运维·服务器·安全·ssh