Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP vs HTTPS #8

Open
AILINGANGEL opened this issue May 27, 2019 · 0 comments
Open

HTTP vs HTTPS #8

AILINGANGEL opened this issue May 27, 2019 · 0 comments

Comments

@AILINGANGEL
Copy link
Owner

HTTP

  • 运行在TCP上,明文传输
  • 端口号:80

HTTPS

  • 运行在SSL(Secure Socket Layer)上
  • 添加了加密和认证机制的HTTP
  • 端口号: 443
  • 加密和解密导致更多的内存资源消耗
  • 需要向认证机构购买证书
  • 采用共享密钥加密和公开密钥加密混合加密方式

HTTPS建立连接的过程

  • 客户端向服务器发送请求
  • 服务器生成自己的公钥和私钥,将公钥和证书一起发给客户端
  • 客户端验证证书是否合法,并且生成自己的秘钥,用公钥将自己的秘钥加密发送给服务器
  • 服务器用私钥解密得到客户端的秘钥, 并将发送给客户端的信息用客户端的秘钥加密发送给客户端
  • 客户端收到信息用自己的秘钥对信息进行解密得到服务器返回的消息
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant