 <blockquote> <p>So, if now i need to make a ssl request i will have to use HttpsURLConnection (?) and create a request.</p> <p>My question is -How does HttpsURLConnection know about the encryption algorithm and then encrypts using that?</p> </blockquote> <p>Yes you have to use HttpsURLConnection. But you dont have to do it explicitly. <code>new URL("https://google.pl").openConnection();</code> is more then enough.</p> <p>In Server Hello, server anounces what encrypiton it can accept. All encryption methods have to "announce" themselves so the server knows how to interpret them. So when you initiatle the connection, servers says what it can handle, client choose one of the cipers and ciper the data using it. At the beginning of the connection, client announces what suite will it use.</p> <p>This information can be public to this is not a problem that this is sent as plaintext. The point is, to exchange the symetric key between client in server in private way, so the rest of communication can be ciphered usint that key.</p> <blockquote> <p>How is session maintained? How does HttpsURLConnection know that this connection has already been initiated and handshake procedures have already been completed?</p> </blockquote> <p>Well SSL stands for Secure Socket Layer. It means that data transmit and received is ciphered, decrypted on raw socket(streams) level; You can open SSL connection to transmit data from point to point not only via Https</p> <p>There is no "session". As long as you open a connection, you got 2 streams. Input and Output. As long as those are open, you can write data or read from them. Once they are closed, you will have to initiate another connection.</p> <p>Every Http request is a new connection (unless Keep-Alive is sent). JsessionId for example, or php's sessionid is to identity that you are the same client that made requests earlier so it can "simulate" constant connection.</p>