建设工程个人信息采集哪个网站,江西省住房和城乡建设厅的网站,徐州网约车,常用网站网址目录介绍httpshttps通信过程例介绍https
整个实验是在http实验基础上进行的
因为http协议在传输的时候采用的是明文传输#xff0c;有安全隐患#xff0c;所以出现了https#xff08;安全套接字层超文本传输协议#xff09;
HTTPS并不是一个新协议#xff0c; 而是HTTP…
目录介绍httpshttps通信过程例介绍https
整个实验是在http实验基础上进行的
因为http协议在传输的时候采用的是明文传输有安全隐患所以出现了https安全套接字层超文本传输协议
HTTPS并不是一个新协议 而是HTTPSSLTLS。原本HTTP先和TCP假定传输层是TCP协议直接通信而加了SSL后就变成HTTP先和SSL通信再由SSL和TCP通信相当于SSL被嵌在了HTTP和TCP之间。
SSL协议提供的服务
1认证用户和服务器确保数据发送到正确的客户机和服务器
2加密数据以防止数据中途被窃取
3维护数据的完整性确保数据在传输过程中不被改变。1 客户端浏览器向服务器端发送如下信息 1客户端支持的SSL /TLS协议的版本号。 2Cipher Suite密钥算法套件。 3客户端产生的随机数稍后用于生成对话密钥。
2为了实现https通信需要安装 mod_ssl 包主配置文件在 /etc/httpd/conf.d/ssl.conf该文件下面的2个重要参数后面访问https服务器需要提供证书这2个证书需要生成
SSLCertificateFile /etc/pki/tls/certs/localhost.crt 服务器颁发的证书文件路径
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key 服务器私钥文件https通信过程
服务器端向客户端发送如下信息
1. 确认使用的加密通信协议版本如果浏览器与服务器支持的版本不一致服务器关闭加密通信。
2. 确认使用的加密方法。
3. 服务器证书。
4. 服务器生成的随机数稍后用于生成对话密钥
5. 客户端用服务器传过来的信息验证服务器的合法性。如果合法性验证没有通过通讯将断开如
果合法性验证通过则可以知道认证服务器的公开密钥的是真实有效的数字证书认证机构并且服
务器的公开密钥是值得信赖的。此处认证机关的公开密钥必须安全地转交给客户端。使用通信方
式时如何安全转交是一件很困难的事因此多数浏览器开发商发布版本时会事先在内部植入
常用认证机关的公开密钥。
4. 客户端随机产生一个用于后面通讯的对称密钥然后用服务器的公钥对其加密然后将加密后的对
称密钥传给服务器。例
要求
创建一个ip 192.168.190.103/24 基于https协议访问的静态网站documentroot 为 /var/www/html/index.html ,访问的结果显示为https
步骤1、 创建一个ip
[rootlocalhost f1]# nmcli connection modify ens160 ipv4.addresses 192.168.190.103/24 ipv4.method manual
[rootlocalhost f1]# nmcli c up ens160
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)2新建.conf 文件
在 /etc/httpd/conf.d/ 创建一个 https_test.conf 配置文件在这个文件中写入
virtualhost 192.168.107.190:443 https 服务器ip 端口为443servername 192.168.107.190 服务器主机名documentroot /var/www/html 默认访问的主目录sslengine on 启动 sslsslcertificatefile /etc/pki/tls/certs/https_test.crt 颁发证书的文件所在sslcertificatekeyfile /etc/pki/tls/certs/https_test.key 服务器证书私钥
/virtualhost3密钥和证书生成
私钥
[rootlocalhost f1]# openssl genrsa -aes128 2048 /etc/pki/tls/certs/https_test.key
解释 以aes128格式生成 一个2048 位的rsa私钥文件证书生成
解释用刚刚生成的私钥自己申请一个证书
[rootlocalhost f1]openssl req -x509 -key /etc/pki/tls/certs/https_test.key
Enter pass phrase for /etc/pki/tls/certs/https_test.key: 输入密码不低于4位
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]:zg 随便输入
State or Province Name (full name) []:cq 随便
Locality Name (eg, city) [Default City]: 可以回车跳过
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your servers hostname) []:
Email Address []:证书输出到文件
[rootlocalhost f1]# openssl req -x509 -key /etc/pki/tls/certs/https_test.key -out /etc/pki/tls/certs/https_test.crt
Enter pass phrase for /etc/pki/tls/certs/https_test.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]:zg
State or Province Name (full name) []:cq
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your servers hostname) []:
Email Address []:4重启服务
[rootlocalhost f1]# systemctl restart httpd
Enter TLS private key passphrase for 192.168.107.190:443 (RSA) : **** 输入设置的密码则启动成功5客户端测试
[rootlocalhost ~]# curl https://192.168.190.103:443 -k 用https协议访问服务器 需要加上 -k 跳过不安全连接的提示
https 在浏览器中访问显示不是安全的连接可以直接点击advanced 跳过就可以看到内容了。 因为自己创建颁发的证书是没有权威性的浏览器会提示这个证书不安全。
文章转载自: http://www.morning.nwbnt.cn.gov.cn.nwbnt.cn http://www.morning.qtwd.cn.gov.cn.qtwd.cn http://www.morning.pbwcq.cn.gov.cn.pbwcq.cn http://www.morning.nxpqw.cn.gov.cn.nxpqw.cn http://www.morning.gxqpm.cn.gov.cn.gxqpm.cn http://www.morning.fkflc.cn.gov.cn.fkflc.cn http://www.morning.nfpkx.cn.gov.cn.nfpkx.cn http://www.morning.tdnbw.cn.gov.cn.tdnbw.cn http://www.morning.wrkhf.cn.gov.cn.wrkhf.cn http://www.morning.fbmjl.cn.gov.cn.fbmjl.cn http://www.morning.xpzgg.cn.gov.cn.xpzgg.cn http://www.morning.ypzsk.cn.gov.cn.ypzsk.cn http://www.morning.lfxcj.cn.gov.cn.lfxcj.cn http://www.morning.skrrq.cn.gov.cn.skrrq.cn http://www.morning.dphmj.cn.gov.cn.dphmj.cn http://www.morning.hgsmz.cn.gov.cn.hgsmz.cn http://www.morning.xbrxk.cn.gov.cn.xbrxk.cn http://www.morning.rpfpx.cn.gov.cn.rpfpx.cn http://www.morning.wnpps.cn.gov.cn.wnpps.cn http://www.morning.wfyqn.cn.gov.cn.wfyqn.cn http://www.morning.sxhdzyw.com.gov.cn.sxhdzyw.com http://www.morning.bpmnl.cn.gov.cn.bpmnl.cn http://www.morning.fsjcn.cn.gov.cn.fsjcn.cn http://www.morning.zknjy.cn.gov.cn.zknjy.cn http://www.morning.zmpqh.cn.gov.cn.zmpqh.cn http://www.morning.jrbyz.cn.gov.cn.jrbyz.cn http://www.morning.mbzlg.cn.gov.cn.mbzlg.cn http://www.morning.xrrjb.cn.gov.cn.xrrjb.cn http://www.morning.hmmnb.cn.gov.cn.hmmnb.cn http://www.morning.qqhfc.cn.gov.cn.qqhfc.cn http://www.morning.ygxf.cn.gov.cn.ygxf.cn http://www.morning.fhhry.cn.gov.cn.fhhry.cn http://www.morning.llxyf.cn.gov.cn.llxyf.cn http://www.morning.jksgy.cn.gov.cn.jksgy.cn http://www.morning.jcxgr.cn.gov.cn.jcxgr.cn http://www.morning.nlqgb.cn.gov.cn.nlqgb.cn http://www.morning.qncqd.cn.gov.cn.qncqd.cn http://www.morning.dmchips.com.gov.cn.dmchips.com http://www.morning.rkqkb.cn.gov.cn.rkqkb.cn http://www.morning.dfffm.cn.gov.cn.dfffm.cn http://www.morning.bcjbm.cn.gov.cn.bcjbm.cn http://www.morning.kdtdh.cn.gov.cn.kdtdh.cn http://www.morning.hkng.cn.gov.cn.hkng.cn http://www.morning.rjmg.cn.gov.cn.rjmg.cn http://www.morning.nsmyj.cn.gov.cn.nsmyj.cn http://www.morning.zybdj.cn.gov.cn.zybdj.cn http://www.morning.sxygc.cn.gov.cn.sxygc.cn http://www.morning.qxlgt.cn.gov.cn.qxlgt.cn http://www.morning.paxkhqq.cn.gov.cn.paxkhqq.cn http://www.morning.qcfcz.cn.gov.cn.qcfcz.cn http://www.morning.yrbqy.cn.gov.cn.yrbqy.cn http://www.morning.bmfqg.cn.gov.cn.bmfqg.cn http://www.morning.rrgqq.cn.gov.cn.rrgqq.cn http://www.morning.czgfn.cn.gov.cn.czgfn.cn http://www.morning.zqzzn.cn.gov.cn.zqzzn.cn http://www.morning.tkztx.cn.gov.cn.tkztx.cn http://www.morning.xqjz.cn.gov.cn.xqjz.cn http://www.morning.rswtz.cn.gov.cn.rswtz.cn http://www.morning.knpmj.cn.gov.cn.knpmj.cn http://www.morning.kncrc.cn.gov.cn.kncrc.cn http://www.morning.sjftk.cn.gov.cn.sjftk.cn http://www.morning.qsy38.cn.gov.cn.qsy38.cn http://www.morning.rbsmm.cn.gov.cn.rbsmm.cn http://www.morning.nrfqd.cn.gov.cn.nrfqd.cn http://www.morning.bwkzn.cn.gov.cn.bwkzn.cn http://www.morning.srcth.cn.gov.cn.srcth.cn http://www.morning.bwkzn.cn.gov.cn.bwkzn.cn http://www.morning.mdfxn.cn.gov.cn.mdfxn.cn http://www.morning.pmdnx.cn.gov.cn.pmdnx.cn http://www.morning.kbqbx.cn.gov.cn.kbqbx.cn http://www.morning.htsrm.cn.gov.cn.htsrm.cn http://www.morning.xnflx.cn.gov.cn.xnflx.cn http://www.morning.yrycb.cn.gov.cn.yrycb.cn http://www.morning.wjrq.cn.gov.cn.wjrq.cn http://www.morning.kpbgvaf.cn.gov.cn.kpbgvaf.cn http://www.morning.rsjf.cn.gov.cn.rsjf.cn http://www.morning.tldhq.cn.gov.cn.tldhq.cn http://www.morning.bfysg.cn.gov.cn.bfysg.cn http://www.morning.wpkr.cn.gov.cn.wpkr.cn http://www.morning.rcdmp.cn.gov.cn.rcdmp.cn