The invention provides a TLS protocol session key restoration method based on random number implicit negotiation, and aims at solving the problem that the existing TLS middleware security protection method cannot meet the current and future TLS middleware use scenarios. The method comprises the following steps that 1, middleware generates a public and private key pair, and sends a public key to aclient; 2, a client stores the public key, shakes hands with a server, constructs a shaking message and sends the shaking message to the server; 3, the middleware stores the handshake message and forwards the handshake message to the server; 4, the server sends a message to the client; 5, the middleware calculates a handshake message encryption key; 6, the middleware decrypts the message, restoresthe session key through calculation, and forwards the received message at the same time; 7, the client sends a message to the middleware after receiving the server message; 8, the middleware forwardsthe message to the server, and generates a session multiplexing main password; 9, the middleware decrypts the TLS traffic and executes a middleware function. The method can be used for the TLS middleware technology, provides network-based security attributes, and greatly reduces the calculation cost of the middleware.