首页 > 编程知识 正文

http https查看,https比http慢多少

时间:2023-05-04 15:24:17 阅读:116723 作者:2208

前言已知https类型的站点比http站点安全,https是启用ssl加密的安全http传输协议。 目前,大多数网站也用https加密。

https实施:由Netscape于1994年创建的SSL :安全套接字层旨在通过Web创建安全的互联网通信。 用于加密浏览器和服务器之间通信的标准协议。 通过互联网安全、轻松地传输账户密码、银行卡、手机号码等私人信息。

PKI:公钥基础设施的主要功能是将图书所有者身份与相关密钥对联系起来(通过向公钥及相关用户身份信息发布数字证书,为用户提供方便的证书申请、证书撤销、证书获取、证书状态查询途径)。 此外,使用与数字证书相关的各种服务(证书颁发、黑名单颁发、时间戳服务等),实现通信中的各实体的身份认证、完整性、防否认性和

CA:认证机构

RA:本注册机构

国际顶级CA颁发机构:

赛门铁克是SSL/TLS证书的主要提供商,为全球100多万台网络服务器提供安全性。 该品牌证书由工信部批准设立的电子认证服务机构“天威诚信”提供鉴证服务。

GeoTrust是世界上第二大数字证书颁发机构,被赛门铁克收购。 该品牌证书由工信部批准设立的电子认证服务机构“天威诚信”提供鉴证服务。

GMO全球证书认证机构是世界上最早的数字证书认证机构之一,致力于网络安全认证和数字证书服务,是可靠的CA和SSL数字证书提供商

中国金融认证中心(CFCA )证书是由中国数字证书认证机构自主研发的纯国产证书。HTTPS证书的选择

专业版OV型不显示企业名称高级版EV型为企业名称HTTPS证书购买选择

一个域名(一个域名)只能绑定多个域名。 可以绑定五个域名通配符域名。 如果您的企业或在线需要注册和使用不限数量的ssl证书,只要Alibaba云(阿里巴巴云)提供平台,就可以购买。 在购买证书之前,请预先审查并通过域名,以确保您的域名可以合法使用。 购买后,将生成证书加密文件。 具体步骤与以下相同,本机无需以CA身份颁发证书或其他步骤。 具体请参阅https://blog.csdn.net/macex 002/article/details/81155713

在企业中实现https负载平衡方案环境:

服务器角色为nginx,php(192.168.10.5 )为web2节点服务器,web2PHP服务器为nginx,MySQL ) 192.168.10.6为web1节点服务器。 web2的数据库nginx(192.168.10.2 )反向代理负载平衡服务器(lb1 ) MySQL (192.168.10.1 ) web1的数据库PHP (192.168.10.1 )

确定是否要安装openssl和版本

rpm -q openssl

检查nginx上是否安装了ssl模块

nginx -V显示结果为--with-http_ssl_module

创建ssl密钥目录,然后导航到该目录

mkdir-p/etc/nginx/SSL _ key CD/etc/nginx/SSL _ key作为证书颁发机构本机运行并创建私钥

[ root @ localhost SSL _ key ] # OpenSSL genrsa-idea-outserver.key 2048 generatingrsaprivatekey, 2048 bitlongmodulus ..... EIS 65537 (0x 10001 ) enterpassphraseforserver . key : # #2048验证- enterpassphraseforserver.key :和输入#2048和输入[ root @ localhost SSL _ key ] # [ root @ localhost SSL _ key ]

[root@localhost ssl_key]# OpenSSL req-days 3650-x509-sha 256-nodes-new key RSA 33602048-keyout server.key-outserver.crtgeneratinga 2048位RSA er.key '---- youareabouttobeaskedtoenterinformationthatwillbeincorporatedintoyourcertiiii

.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 blankFor some fields there will be a default value,If you enter '.', the field will be left blank.-----Country Name (2 letter code) [XX]:bjState or Province Name (full name) []:bjLocality Name (eg, city) [Default City]:bjOrganization Name (eg, company) [Default Company Ltd]:bjOrganizational Unit Name (eg, section) []:bjCommon Name (eg, your name or your server's hostname) []:bjEmail Address []:123456@163.com[root@localhost ssl_key]# [root@localhost ssl_key]# lsserver.crt server.key

配置web1网站配置文件
编辑blog.benet.com,添加加密项

server { listen 443 ssl; #监听443,加密 server_name blog.benet.com; ssl_certificate ssl_key/server.crt; ssl_certificate_key ssl_key/server.key; root /www/wordpress; index index.php index.html; location ~ .php$ { root /www/wordpress; fastcgi_pass 192.168.10.3:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }server { #添加此项是为了人们习惯不输入https也可以访问 listen 80; server_name blog.benet.com;# rewrite .* https://blog.benet.com;# rewrite .* https://$host$request_uri redirect;# rewrite .* https://$server_name$request_uri redirect; rewrite .* https://$server_name$1 redirect;}保存退出systemctl restart nginx

在web2上相同的操作,scp复制

[root@web2 nginx]# scp root@192.168.10.6:/etc/nginx/conf.d/blog.conf ./conf.d/别忘了把加密证书文件拷贝过来[root@web2 nginx]# scp -rp root@192.168.10.6:/etc/nginx/ssl_key ./

修改配置文件,把php服务器换成web2的

fastcgi_pass 192.168.10.3:9000;===> fastcgi_pass 127.0.0.1:9000;保存退出systemctl restart nginx

最后修改lb1的配置文件,因为之前都做过负载均衡,保留的快照

upstream web_cluster { server 192.168.10.6:443 weight=1; server 192.168.10.5:443 weight=1; }server { listen 443 ssl; 监听https,加密 server_name blog.benet.com; ssl_certificate ssl_key/server.crt; #线上购买后会生成正规的证书 ssl_certificate_key ssl_key/server.key; location / { proxy_pass https://web_cluster; include nginx_params; }}server { listen 80; server_name blog.benet.com; return 302 https://$server_name$1;}保存退出先不要重启服务

这里还没有加密证书文件,需要拷贝过来

[root@localhost ~]# scp -rp root@192.168.10.6:/etc/nginx/ssl_key /etc/nginxThe authenticity of host '192.168.10.6 (192.168.10.6)' can't be established.ECDSA key fingerprint is 48:f0:af:77:9c:03:5c:b5:ca:8f:cd:47:72:1e:5e:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.10.6' (ECDSA) to the list of known hosts.root@192.168.10.6's password: server.key 100% 1704 1.7KB/s 00:00 server.crt 100% 1334 1.3KB/s 00:00 [root@localhost ~]# systemctl restart nginx

客户端修改/etc/hosts文件,域名指定lb1
访问测试:输入https://blog.benet.com或blog.benet.com都可以。

会提示:

添加例外,最后熟悉的界面又来啦,刷新

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。