HTTPS的简单实践
随着互联网的发展趋势,更多的网站都采取了这些安全的协议,下面由爱站技术频道小编给大家介绍HTTPS的简单实践,希望对你学习这方面知识有所帮助。
第一个里程碑:创建https证书
[root@web01 backup]# openssl req -new -x509 -nodes -out server.crt -keyout server.key
Generating a 2048 bit RSA private key
......................................................+++
...................................+++
writing new private key to 'server.key'
-----
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]:CH #国家名称
State or Province Name (full name) []:bj #省
Locality Name (eg, city) [Default City]:bj #市
Organization Name (eg, company) [Default Company Ltd]:ZNIX #组织名称
Organizational Unit Name (eg, section) []:ZNIX #组织名称
Common Name (eg, your name or your server's hostname) []:ZNIX #服务器名称
Email Address []:ADMIN@ZNIX.TOP #邮箱
查看产生的证书
[root@web01 backup]# ls
server.crt server.key
生成的密钥文件
[root@web01 backup]# ll
total 8
-rw-r--r-- 1 root root 1375 Nov 6 14:07 server.crt
-rw-r--r-- 1 root root 1704 Nov 6 14:07 server.key
openssl参数说明
参数 |
参数说明 |
req |
PKCS#10 X.509 Certificate Signing Request (CSR)Management. PKCS#10 X.509证书签名请求(CSR)管理。 |
x509 |
X.509 Certificate Data Management. X.509证书数据管理。 |
以上就是爱站技术频道小编介绍的HTTPS的简单实践,我们需要随时保持清醒的头脑,让项目变得越来越好。