当前位置:网站首页>redhat/openssl生成自签ca证书并使用
redhat/openssl生成自签ca证书并使用
2022-07-31 13:51:00 【Gur.】
一键生成自签名ssl证书和私钥
./create_self_signed_cert.sh"/C=CN/ST=Guangdong/L=Guangzhou/O=xdevops/OU=xdevops/CN=gitlab.xdevops.cn"
检查OpenSSL
检查是否已经安装openssl
openssl version
一般在CentOS7上,openssl已经默认安装好了。
生成自签名的SSL证书和私钥
第一步:生成私钥
# genra 生成RSA私钥
# -des3 des3算法
# -out server.key 生成的私钥文件名
# 2048 私钥长度
openssl genrsa -des3 -out server.pass.key 2048
第二步:去除私钥中的密码
openssl rsa -in server.pass.key -out server.key
第三步:生成CSR(证书签名请求)
# req 生成证书签名请求
# -new 新生成
# -key 私钥文件
# -out 生成的CSR文件
# -subj 生成CSR证书的参数
openssl req -new -key server.key -out server.csr -subj "/C=CN/ST=Guangdong/L=Guangzhou/O=xdevops/OU=xdevops/CN=gitlab.xdevops.cn"
第四步:生成自签名SSL证书
# -days 证书有效期
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
在文件中的编辑以下配置并保存:
# 监听端口
Listen 443 https
# 服务器域名
ServerName localhost
# 服务器签名证书文件
SSLCertificateFile /data/ssl/server.crt
# 服务器秘钥文件
SSLCertificateKeyFile /data/ssl/server.key
# CA 证书(双向认证)
# SSLCACertificateFile /data/ssl/ca/ca.pem
边栏推荐
- 技能大赛dhcp服务训练题
- leetcode:2032. Values that appear in at least two arrays
- leetcode: 485. Maximum number of consecutive 1s
- AWS实现定时任务-Lambda+EventBridge
- The Selenium IDE of the Selenium test automation
- [Niu Ke brush questions - SQL big factory interview questions] NO3. E-commerce scene (some east mall)
- For enterprises in the digital age, data governance is difficult, but it should be done
- Node version switching management using NVM
- Use of C# Assembly
- ECCV 2022 | Robotic Interaction Perception and Object Manipulation
猜你喜欢
CLion用于STM32开发
Linux bash: redis-server: command not found
LeetCode·每日一题·1161.最大层内元素和·层次遍历
232层3D闪存芯片来了:单片容量2TB,传输速度提高50%
AWS实现定时任务-Lambda+EventBridge
An article makes it clear!What is the difference and connection between database and data warehouse?
go使用makefile脚本编译应用
多智能体协同控制研究中光学动作捕捉与UWB定位技术比较
IDEA如何运行web程序
A detailed explanation of the usage of Async and Await in C#
随机推荐
pytorch gpu版本安装最新
代码随想录笔记_哈希_454四数相加II
[QNX Hypervisor 2.2用户手册]9.14 safety
CodeIgniter 打开错误日志
Solution for browser hijacking by hao360
The batch size does not have to be a power of 2!The latest conclusions of senior ML scholars
Shell项目实战1.系统性能分析
Shell script classic case: backup of files
VU 非父子组件通信
报错:npm ERR code EPERM
机器学习模型验证:被低估的重要一环
uniapp微信小程序引用标准版交易组件
ICML2022 | 面向自监督图表示学习的全粒度自语义传播
jOOQ 3.14 released - SQL/XML and SQL/JSON support
八大排序汇总及其稳定性
推荐系统-召回阶段-2013:DSSM(双塔模型)【Embedding(语义向量)召回】【微软】
The Selenium IDE of the Selenium test automation
SetoolKit使用指南
AI cocoa AI frontier introduction (7.31)
战略进攻能力的重要性,要远远高于战略防守能力