一 什么是HTTPS
由于HTTP协议是已明文进行传输的,这就造成了传输的数据易被拦截泄露。为解决HTTP传输的过程中无法保证其安全性的问题,HTTPS就诞生了。https 是具有安全性的ssl加密传输协议,数据在离开发送端前被加密,到客户端是在进行解密。这样就使得数据在传输过程中的安全性大大提高了,但同时由于其数据被加密,加密后的大小明显大于未加密之前的数据,也增加了传输链路的负担。
二 HTTPS搭建
- 申请证书
[root@localhost certs]#
[root@localhost certs]#
[root@localhost ~]# cd /etc/pki/tls/certs/
[root@localhost certs]#
[root@localhost certs]#
#建立服务器私钥
[root@localhost certs]# make server.key
umask 77 ; \
/usr/bin/openssl genrsa -aes128 2048 > server.key
Generating RSA private key, 2048 bit long modulus
..........................+++
.................+++
e is 65537 (0x10001)
Enter pass phrase:
Verifying - Enter pass phrase:
[root@localhost certs]#
[root@localhost certs]#
#删除密钥中的口令,防止系统启动被询问口令
[root@localhost certs]# openssl rsa -in server.key -out server.key
Enter pass phrase for server.key:
writing RSA key
[root@localhost certs]#
[root@localhost certs]#
[root@localhost certs]# ls
ca-bundle.crt make-dummy-cert renew-dummy-cert
ca-bundle.trust.crt Makef