利用Openssl制作自签名证书
在apache
或者nginx
启用HTTPS
后,需要加密证书才能正常工作。我们现在可以利用OpenSSL
工具简单快速的创建一个自签名证书。
1 安装Openssl
在配置好yum
源的情况下,可以使用yum
方式快速安装openssl
包。
首先检测当前系统是否安装openssl
,然后查看openssl
包的信息:
[root@Centos7 R4 ~]#rpm -ql openssl
package openssl is not installed
[root@Centos7 R4 ~]#yum info openssl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
Name : openssl
Arch : x86_64
Epoch : 1
Version : 1.0.1e
Release : 60.el7
Size : 713 k
Repo : CDRom
Summary : Utilities from the general purpose cryptography library with TLS implementation
URL : http://www.openssl.org/
License : OpenSSL
Description : The OpenSSL toolkit provides support for secure communications between
: machines. OpenSSL includes a certificate management tool and shared
: libraries which provide various cryptographic algorithms and
: protocols.
开始安装
[root@Centos7 R4 ~]#yum install openssl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package openssl.x86_64 1:1.0.1e-60.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================