http://www.codeweblog.com/ssl-handshake-process-of-interaction-and/

SSL to send a message in the following order:
1.Client Hello
Client sends the server information including passwords group it supports. Password set in cryptographic algorithms and key sizes;
2.Server Hello
The server choose the client and server support the password set to the client.
3.Certificate
Server sends a certificate or a certificate chain to the client, a certificate chain, starting at the end of the server public key certificate and the root certificate authority in the show. This information is optional, but the server certificate as necessary, to use it.
4.Certificate request
When the server needs to identify clients, it sends a certificate request to the client. In web applications, very little to send the message.
5.Server key exchange
When the server sends to the public key of the key exchange is not very good when a server key exchange message to send.
6.Server hello done
Server to tell clients to complete its initialization flow of information.
7.Certificate
If the server requires a client certificate, the client sends a certificate chain. (Only when the server requires client certificate)
8.Client key exchange
Customers generate a key for the symmetric algorithm. Customers with a server on the RSA public key cryptography this key information and send it to the server.
9.Certificate verify
In web applications, very few send this message, it is primarily used to allow the server to handle the end of the customer identification. When using this information, the client sends a password function of the digital signature information to the server, when the service ended with a public key to decrypt the message, the server can identify clients.
10.Change cipher spec
Client sends a message to tell the server to change the encryption mode.
11.Finished
Client tells the server it is ready to secure data communication.
12.Change cipher spec
Server sends a message to the client and tell clients modify encrypted mode.
13.Finished
Server tells the client that it is ready to secure data communication. This is a client-server handshake protocol the last step.
14.Encrypted data
Client with the server using a symmetric encryption algorithm and cryptographic functions, and with the client to the server secret key encrypted communication.
SSL handshake process:
Extracted from the "SSL and TLS"
Objective:
1. The client and server need to protect data on a set of algorithms for consensus;
2. They need to establish a set of algorithms that are used by the encryption key;
3. Handshake can also choose to authenticate the client.

Process:
1. Client list and its support for the algorithm used to generate a random number key sent to the server;
2. Server list from the algorithm to choose a encryption algorithm, and it contains the server public key and a certificate sent to the client; The certificate also contains the server ID for authentication purposes, the server also provides a generate random numbers for keys;
3. Client-side validation on the server's certificate (certificate of verification, can refer to the digital signature), and to take the server's public key; then, and then generate a random password string called pre_master_secret, and use the server's public key pair The encrypted (refer to non-symmetric encryption / decryption), and encrypted information is sent to the server;
4. Client-side and server-side and under the pre_master_secret client and server calculate a random value independent encryption and MAC keys (see DH key exchange algorithm).
5. Client MAC values of all handshake messages sent to the server;
6. Server MAC values of all handshake messages sent to the client.

Step 5 and 6 to prevent themselves from being tampered with shaking hands. Envisaged an attacker wants to control the use of client and server algorithms. Client offers a variety of algorithms are quite common, some of the strength of weak and some strong intensity, in order to be able to support the weak intensity algorithm with only the server to communicate. An attacker can remove the client provided in step 1 all the high-intensity algorithm, so they force the server to choose a weak strength of the algorithm. Step 5 and Step 6 of the MAC be able to prevent the exchange of such attacks, because the client's MAC is calculated according to the original message, but the server's MAC is modified according to the news of the attacker is calculated, so that after inspection will find do not match. As provided by the client and server random number key generation process, and so the hands will not be replay attacks. The message is the first in a new encryption algorithm and key messages encrypted under.

Just described every step through one or more handshake messages to achieve. In this first message with a brief description of which corresponds to what steps, then a detailed description of the contents of each message. The following diagram describes the messages:

Step 1 corresponds to a single handshake message, ClientHello.
Step 2 corresponds to a SSL handshake message, the server sends the first message to ServerHello, which contains its chosen method, then again in the Certificate message send their certificates. Finally, the server sends a message to indicate ServerHelloDone the completion of the handshake stage. Need ServerHelloDone because some of the more complex variants would also like to shake hands after the Certifacate send other messages. When the client receives ServerHelloDone message, it knows there will be no other similar news coming, so he can continue it on this side of the handshake.
Step 3 corresponds to ClientKeyExchange news.
Step 5 and 6 corresponding Finished message. The news is just negotiated the first algorithm used to protect the information. In order to prevent the handshake has been tampered with, the contents of the message to all the previous stage handshake message MAC. However, the Finished message is a good method of protection, consultations, so they will have consultations with the new MAC key - a message from the calculation of the value of their MAc.
Note that the image above omits two ChangeCipherSpec news.
SSL Record Protocol:
In SSL, the actual data transmission is to use the SSL record protocol to achieve. SSL record protocol is divided by the data stream into a series of clips and transfer them to work, in which each fragment separately protection and transmission. In the receiver, each record on a separate decryption and verification. This program has resulted in the figures have been ready to be sent from one end to connect to the other end, and received instantly be addressed.
In the transmission segment, you must prevent attacks. MAC can be calculated to provide data integrity protection. MAC transmitted together with the fragment, verified by the receiver to achieve. The MAC appended to the fragment of the tail, and data and integrate the contents of the MAC is encrypted to form encrypted Load (Payload). Finally on top of information to the load equipment. Header information and encrypted links to known records of load (record), record the actual transfer of the content is. The following diagram describes the transfer process:

1. Recorded the first message:
Record header information is to receive the work to achieve (receiving implementation) to explain the records provided the necessary information. In practice, it refers to three types of information: content type, length, and SSL version. Length field can the receiver is aware that he was taken from the line Duoshao octet processing the message, version number, Zhi Shi 1 to ensure that each party use the consultation version of the redundancy check. Content-Type field indicates the message type.
2. SSL Record Type:
SSL support for the four content types: application_data, alert, handshake and change_cipher_spec.
Use SSL, software to send and receive all the data are based on application_data type to send, the other three kinds of Neirongleixing used on communications Jinxingguanli, Ruwan Cheng handshake and reporting Cuowu so.
Content type alert is mainly used for reporting all types of errors. Most of the alert (warning) for reporting handshake Chuxian problems, but there are some instructions to try to Jin Xing Ji Lu Zai right or Renzheng decryption errors that occur, alert messages to other Yongtu yes instructions would be Guanbi Lian Jie.
Used to carry content type handshake handshake message. Even if the initial connection handshake message is formed by the recording layer in order to handshake types of records to load the. As the encryption key has not yet established, these initial message was not encrypted or authentication, but the other process is the same. Possible existing connections on a new handshake initialization, in this case, the new record is like shaking hands, like other data, to go through encryption and authentication.
change_cipher_spec recorded message said to change the encryption and authentication. Once the handshake agreed on a new set of keys, the send change_cipher_spec to indicate at this point will enable the new key.
Work with a variety of sources:
As we have seen, SSL is a layered protocol, it is a recording layer and recording layer of a CD bearing the same message type composition. And the recording layer will by some reliable transport protocol such as TCP to carry. The following diagram describes the structure of the Association to:

The complete process a ssl connection:

SSL握手步骤【收藏】的更多相关文章

  1. SSL握手过程

    原文地址: http://my.oschina.net/u/1188877/blog/164982 一.SSL握手有三个目的:1. 客户端与服务器需要就一组用于保护数据的算法达成一致:2. 它们需要确 ...

  2. SSL握手流程

    一.SSL是什么? 安全套接字(SSL)协议是Web浏览器和Web服务器之间安全交换信息的协议. SSL介于应用层和TCP层之间,应用层数据不再直接传递给传输层,而是传递给SSL层,SSL层对从应用层 ...

  3. ssl握手数据结构

    ssl握手 SSL记录头(5字节) 字节0:记录内容的类型 Content Type Hex Code Description Change_Cipher_Spec 0x14 指示加密方式的更改 Al ...

  4. HTTPS和SSL握手过程(转载)

    https介绍 HTTPS = HTTP + 一组对称.非对称和基于证书的加密技术 HTTPS是最常见的HTTP安全版本.它得到了很广泛的应用,所有主要的商业浏览器和服务器都提供HTTPS.HTTPS ...

  5. 加密、签名和SSL握手机制细节

    openssl系列文章:http://www.cnblogs.com/f-ck-need-u/p/7048359.html 1.1 背景知识 对称加密     :加密解密使用同一密钥,加解密速度快.随 ...

  6. SSL握手通信详解及linux下c/c++ SSL Socket代码举例

    SSL握手通信详解及linux下c/c++ SSL Socket代码举例 摘自:http://www.169it.com/article/3215130236.html   分享到:8     发布时 ...

  7. SSL握手通信详解及linux下c/c++ SSL Socket代码举例(另附SSL双向认证客户端代码)

    SSL握手通信详解及linux下c/c++ SSL Socket代码举例(另附SSL双向认证客户端代码) 摘自: https://blog.csdn.net/sjin_1314/article/det ...

  8. SSL 重点SSL会话步骤

    SSL.TLS协议 在wiki百科查看下,两者的区别 实现SSL协议的软件 OpenSSL开源软件 SSL会话步骤 1:客户端向服务端索取CA证书,然后验证证书   2:客户端与服务端约定一个通信中使 ...

  9. linux apache Tomcat配置SSL(https)步骤

    https简介 它是由Netscape开发并内置于其浏览器中,用于对数据进行压缩和解压操作,并返回网络上传送回的结果.HTTPS实际上应用了Netscape的安全套接字层(SSL)作为HTTP应用层的 ...

随机推荐

  1. python实现自动发送微博,当自己写博客时同步上去。

    一.需求: 自己在github上搭建一个基于Jekyll的博客(http://beginman.cn/),每次写完博客后就要push上去,博客写的再好,基本上没人访问,为了增加访问量,就想利用起来微博 ...

  2. 针对远程Git代码库使用SSH公匙

    → 运行Git Bash→ 创建SSH公匙和私匙ssh-keygen -t rsa→ 输入SSH公匙存放文件,选择使用默认的,按Enter→ 如果已经存在,提示是否重写,输入n,按Enter→ 打开C ...

  3. Revit2013工具栏工具无法显示BUG

    该BUG在Revit2013版中存在,主要症状就是当你激活某些工具的时候,上部工具栏中本应该显示的上下文工具显示不出来,比如当你选中模型中的风管的时候,正常情况下工具栏应该是这个样子. 但是在Revi ...

  4. 【原】MyEclipse8.5集成Tomcat7时启动错误:Exception in thread “main” java.lang.NoClassDefFoundError

    解决方法: MyEclipse->Window->Preferences->MyEclipse->Servers->Tomcat->Tomcat 6.x->L ...

  5. Lotus Domino中使用Xpage技术打造通讯录

    我们来完成一个类似通讯录的功能,我们可以添加人员,查看和修改,删除人员,我们假设我们的通讯录中只记录人员的名字和年龄字段.先看看完成后的效果吧 点击New可以到新增人员页面,如下图: 编辑按钮后进入编 ...

  6. 连接UI到代码

    本章,你将连接FoodTracker应用程序的UI到代码并定义一些可执行的动作.当你完成时,你的应用程序将是这个样子: 学习目标在课程结束时,你将能够:1.解释一个storyboard中的场景和vie ...

  7. 利用Mysql提供的字符串方法查找字符串中某字符出现的次数

    有这么一个需求,查出分类中没有子分类的一级分类,脑海中首次出现的解决思路和这样的 先使用PHP查出所有的一级分类 递归查询一级分类是否有子分类 将没有子分类的一级分类汇总 但觉的这样处理太麻烦了,然后 ...

  8. Hadoop学习-生态体系(ecosystem)概览

    0. 大背景 全球No.1搜索引擎公司谷歌(Google)面临每天海量搜索引擎数据的问题,经过长时间的实践积累, 谷歌形成了自己的大数据框架,但是并没有开源,而是发表了一篇论文,阐述了自己的思想,在论 ...

  9. C# 个人常用代码积累

    /// <summary> /// TextBox限制只能输入十六进制,且只能输入6个 /// </summary> /// <param name="send ...

  10. Hadoop 生态系统

    1.概述 最近收到一些同学和朋友的邮件,说能不能整理一下 Hadoop 生态圈的相关内容,然后分享一些,我觉得这是一个不错的提议,于是,花了一些业余时间整理了 Hadoop 的生态系统,并将其进行了归 ...