使用OpenSSL创建证书。采用的OS为CentOS7.

1. 修改OpenSSL的配置文件

vim /etc/pki/tls/openssl.cnf
[ CA_default ]

dir             = /etc/pki/CA           # Where everything is kept
certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file.
#unique_subject = no # Set to 'no' to allow creation of
# several ctificates with same subject.
new_certs_dir = $dir/newcerts # default place for new certs. certificate = $dir/my-ca.crt # The CA certificate
serial = $dir/serial # The current serial number
crlnumber = $dir/crlnumber # the current crl number
# must be commented out to leave a V1 CRL
crl = $dir/crl.pem # The current CRL
private_key = $dir/private/my-ca.key # The private key
RANDFILE = $dir/private/.rand # private random number file x509_extensions = usr_cert # The extentions to add to the cert

2. 准备文件目录

cd /etc/pki/CA
rm -rf *
cd /etc/pki/tls/misc
./CA -newca
ctrl-c

创建Serial文件

cd /etc/pki/CA
echo 00 > serial

3. 生成根密钥

cd /etc/pki/CA
openssl genrsa -out private/my-ca.key
or
( umask 077; openssl genrsa -out private/cakey.pem )

4. 生成根证书

openssl req -new -x509 -key private/my-ca.key -out my-ca.crt

5. 创建用户证书密钥和证书请求文件

cd /root
openssl genrsa -out nginx.key
openssl req -new -key nginx.key -out nginx.csr

6. 用CA签署证书

openssl ca -in nginx.csr -out nginx.crt

这样,证书就创建成功了。

OpenSSL创建证书的更多相关文章

  1. 使用Openssl创建证书

    概述 SSL证书通过在客户端浏览器和Web服务器之间建立一条SSL安全通道(Secure socketlayer(SSL),SSL安全协议主要用来提供对用户和服务器的认证:对传送的数据进行加密和隐藏: ...

  2. openssl 创建证书的总结和注意事项

    1.该文章从网上看了好多博客,并经过实践形成.环境为ubuntu12和ubuntu14 "========================================大纲提要和注意事项= ...

  3. 使用openssl创建自签名证书及部署到IIS教程

    概要 本文讲解三个部分:1. 创建自签名证书2. 创建自己的证书颁发机构3. 以及如何配置IIS 创建自签名证书 首先,创建一个私钥文件: openssl genrsa -out myselfsign ...

  4. 使用 OpenSSL 创建私有 CA:3 用户证书

    OpenSSL 创建私有 CA 三部曲:使用 OpenSSL 创建私有 CA:1 根证书使用 OpenSSL 创建私有 CA:2 中间证书使用 OpenSSL 创建私有 CA:3 用户证书 在前文&l ...

  5. 使用 OpenSSL 创建私有 CA:2 中间证书

    OpenSSL 创建私有 CA 三部曲:使用 OpenSSL 创建私有 CA:1 根证书使用 OpenSSL 创建私有 CA:2 中间证书使用 OpenSSL 创建私有 CA:3 用户证书 本文将在前 ...

  6. 使用 OpenSSL 创建私有 CA:1 根证书

    OpenSSL 创建私有 CA 三部曲:使用 OpenSSL 创建私有 CA:1 根证书使用 OpenSSL 创建私有 CA:2 中间证书使用 OpenSSL 创建私有 CA:3 用户证书 OpenS ...

  7. centos 配置Openssl并创建证书

    具体详情参考:http://wiki.centos.org/HowTos/Https 一.安装软件 yum install mod_ssl openssl 二.创建证书: # Generate pri ...

  8. [转帖]用 OpenSSL 创建可以用于 https 的证书

    用 OpenSSL 创建可以用于 https 的证书 开会时 说到了安全问题 就简单鼓捣了一下 以后还是用nginx 转发比较好一些. https://blog.csdn.net/joyous/art ...

  9. RSA非对称加密,使用OpenSSL生成证书,iOS加密,java解密

    最近换了一份工作,工作了大概一个多月了吧.差不多得有两个月没有更新博客了吧.在新公司自己写了一个iOS的比较通用的可以架构一个中型应用的不算是框架的一个结构,并已经投入使用.哈哈 说说文章标题的相关的 ...

随机推荐

  1. .net core 2.2部署到Windows Server 2012 R2 standard

    安装.net core 2.2 下载地址:https://dotnet.microsoft.com/download/dotnet-core/2.2 找到ASP.NET Core Runtime 2. ...

  2. .Net IOC框架入门之——Autofac

    一.简介  Autofac是.NET领域最为流行的IOC框架之一,传说是速度最快的一个 目的 1.依赖注入的目的是为了解耦.2.不依赖于具体类,而依赖抽象类或者接口,这叫依赖倒置.3.控制反转即IoC ...

  3. 常用的python内置模块

    1.time模块: time模块是普通的时间模块 在python的三种时间表现形式: 1.时间戳: 给电脑看的. - 自1970-01-01 00:00:00到当前时间,按秒计算,计算了多少秒. 2. ...

  4. Laravel处理session(会话)的方法详解

    在Web应用程序中,有必要识别跨越请求的用户并为每个用户保存数据,为此,像Laravel这样的框架提供了一种称为会话的机制.本篇文章就来为大家介绍关于Laravel处理session(会话)的方法. ...

  5. ELK——Elasticsearch 搭建集群经验

    本文内容 背景 ES集群中第一个master节点 ES slave节点 迁移到:http://www.bdata-cap.com/newsinfo/1712679.html 本文总结 Elastics ...

  6. MySql5.7配置文件my.ini 设置 my.ini文件路径

    mysql配置文件my-default.ini  my.ini修改后重启无效,原来是路径错了,记录一下: windows操作系统下: 1. 由于我们使用MySql 时,需要修改mysql 的 my.i ...

  7. Global variable in ABAP function group

    Function group is loaded into runtime memory by the FIRST call of a function module inside this func ...

  8. mysql 无法连接提示 Authentication plugin 'caching_sha2_password' cannot be loaded

    mysql 无法连接提示 Authentication plugin 'caching_sha2_password' cannot be loaded 可能是密码没有设置或者,密码设置类型不符,可参考 ...

  9. Linux文件增删改

    Linux目录/文件增删改 创建文件 (1) # touch  <文件名称> (2) 花括号展开 touch /root/{1,3,9}.txt touch /root/{0..100}. ...

  10. HDU 1372 Knight Moves 题解

    Knight Moves Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tota ...