Question: how ssl works step by step?
Answer: The client sends a "client hello" message. ... 
The server responds with a "server hello" message. ... 
The client verifies the server's SSL certificate from CA (Certificate Authority) and authenticates the server. ... 
The client creates a session key, encrypts it with the server's public key and sends it to the server.