当前位置: 首页 > news >正文

linux 生成 ca 证书

自建证书

创建用私钥签名的证书

生成私钥
openssl genrsa -out private.key 2048
生成证书请求
openssl req -new -key private.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) [XX]:CN
State or Province Name (full name) []:GD
Locality Name (eg, city) [Default City]:GZ
Organization Name (eg, company) [Default Company Ltd]:GZGZ
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:XXXXX.XXXX.com
Email Address []:xxxxxxxx@xx.comPlease enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
其中,Common Name 填写证书绑定的域名,否则证书不能通过信任验证。
生成服务器的私钥
openssl rsa -in private.key -out server.key
使用私钥生成服务器证书
openssl x509 -req -in server.csr -out server.crt -outform pem -signkey server.key -days 365 -sha256

下面的 gitlab 的自建证书过程

Generation of a Self Signed Certificate
Generation of a self-signed SSL certificate involves a simple 3-step procedure:

STEP 1: Create the server private key

openssl genrsa -out gitlab.key 2048

STEP 2: Create the certificate signing request (CSR)

openssl req -new -key gitlab.key -out gitlab.csr

STEP 3: Sign the certificate using the private key and CSR

openssl x509 -req -days 3650 -in gitlab.csr -signkey gitlab.key -out gitlab.crt

Congratulations! You now have a self-signed SSL certificate valid for 10 years.

Strengthening the server security
This section provides you with instructions to strengthen your server security. To achieve this we need to generate stronger DHE parameters.

openssl dhparam -out dhparam.pem 2048

相关文章:

  • 体悟PyTorch的优雅
  • 毫无基础的人如何入门 Python ?
  • 十分钟GIS——geoserver+postgis+udig从零开始发布地图服务
  • hadoop使用公平调度器
  • 包装组件的优点和可能的挑战
  • 鸿蒙开发系列教程(十六)--日志处理
  • B2052 简单计算器(洛谷)
  • Vue3快速上手(二)VSCode官方推荐插件安装及配置
  • IDEA 推荐插件
  • 苹果macbook电脑删除数据恢复该怎么做?Mac电脑误删文件的恢复方法
  • 天线阵列车载应用——第1章 介绍 1.1节 汽车工业中的天线阵列:应用和频率范围
  • android下library打包aar并上传到maven,嵌入版的app
  • 爬虫笔记(三):实战qq登录
  • 视频上传 - 断点续传那点事
  • IDEA新建文件夹后右击不能创建class类排错方法
  • JS中 map, filter, some, every, forEach, for in, for of 用法总结
  • 自己简单写的 事件订阅机制
  • (十五)java多线程之并发集合ArrayBlockingQueue
  • Android Studio:GIT提交项目到远程仓库
  • Android Volley源码解析
  • Druid 在有赞的实践
  • GraphQL学习过程应该是这样的
  • Java到底能干嘛?
  • vue从创建到完整的饿了么(18)购物车详细信息的展示与删除
  • Work@Alibaba 阿里巴巴的企业应用构建之路
  • 多线程 start 和 run 方法到底有什么区别?
  • 区块链技术特点之去中心化特性
  • 物联网链路协议
  • k8s使用glusterfs实现动态持久化存储
  • ​Spring Boot 分片上传文件
  • #大学#套接字
  • (03)光刻——半导体电路的绘制
  • (11)工业界推荐系统-小红书推荐场景及内部实践【粗排三塔模型】
  • (27)4.8 习题课
  • (51单片机)第五章-A/D和D/A工作原理-A/D
  • (C++)八皇后问题
  • (html5)在移动端input输入搜索项后 输入法下面为什么不想百度那样出现前往? 而我的出现的是换行...
  • (附源码)springboot工单管理系统 毕业设计 964158
  • (蓝桥杯每日一题)平方末尾及补充(常用的字符串函数功能)
  • (删)Java线程同步实现一:synchronzied和wait()/notify()
  • (十一)c52学习之旅-动态数码管
  • (四)JPA - JQPL 实现增删改查
  • .md即markdown文件的基本常用编写语法
  • .NET Conf 2023 回顾 – 庆祝社区、创新和 .NET 8 的发布
  • .net mvc部分视图
  • .net 程序 换成 java,NET程序员如何转行为J2EE之java基础上(9)
  • .NET/C# 使用反射调用含 ref 或 out 参数的方法
  • .net经典笔试题
  • .NET开源项目介绍及资源推荐:数据持久层
  • [.net] 如何在mail的加入正文显示图片
  • [20170705]lsnrctl status LISTENER_SCAN1
  • [2019.2.28]BZOJ4033 [HAOI2015]树上染色
  • [Angular] 笔记 9:list/detail 页面以及@Output
  • [BJDCTF2020]The mystery of ip1
  • [BZOJ] 2006: [NOI2010]超级钢琴