Http Vs Https

Hi everyone, I am Anusha Nayak. ๐I am passionate about bridging the realms of development and operations to propel efficient and seamless software delivery! ๐ป As a DevOps professional, I'm all about making things run smoother, like cutting out unnecessary steps, setting up automatic software installations, and making sure everything flows together nicely๐จโ๐ป. I want to help teams create great software quickly every single time.
๐๐๐๐ (๐๐ฒ๐ฉ๐๐ซ๐ญ๐๐ฑ๐ญ ๐๐ซ๐๐ง๐ฌ๐๐๐ซ ๐๐ซ๐จ๐ญ๐จ๐๐จ๐ฅ) is the underlying protocol used for communication on the World Wide Web.
Here's a overview of how it works:
1. ๐๐น๐ถ๐ฒ๐ป๐ ๐ฅ๐ฒ๐พ๐๐ฒ๐๐: ๐ฅ๏ธ A client (usually a web browser) initiates an HTTP request to a server by specifying a URL (Uniform Resource Locator) in the browser's address bar or by clicking on a link.
2. ๐๐ก๐ฆ ๐๐ผ๐ผ๐ธ๐๐ฝ: ๐ If the URL contains a domain name (e.g., www.example.com), the browser performs a DNS lookup to obtain the server's IP address.
3. ๐ง๐๐ฃ ๐๐ผ๐ป๐ป๐ฒ๐ฐ๐๐ถ๐ผ๐ป: ๐ The client establishes a TCP (Transmission Control Protocol) connection with the server on port 80 (or 443 for HTTPS) to initiate communication.
4. ๐๐ง๐ง๐ฃ ๐ฅ๐ฒ๐พ๐๐ฒ๐๐: ๐ก The client sends an HTTP request message to the server. This request consists of a request line (which includes the HTTP method, such as GET or POST), headers (additional information about the request), and sometimes a message body (data to be sent to the server, typically with methods like POST).
5. ๐ฆ๐ฒ๐ฟ๐๐ฒ๐ฟ ๐ฃ๐ฟ๐ผ๐ฐ๐ฒ๐๐๐ถ๐ป๐ด: ๐ฅ๏ธโ๏ธ The server receives the request, processes it, and generates an HTTP response. This may involve accessing databases, executing scripts, or retrieving files.
6. ๐๐ง๐ง๐ฃ ๐ฅ๐ฒ๐๐ฝ๐ผ๐ป๐๐ฒ: ๐ฌ The server sends an HTTP response message back to the client. This response includes a status line (indicating whether the request was successful or not), headers (additional information about the response), and possibly a message body (the requested content).
7. ๐๐ผ๐ป๐๐ฒ๐ป๐ ๐ฅ๐ฒ๐ป๐ฑ๐ฒ๐ฟ๐ถ๐ป๐ด: ๐ผ๏ธ The client receives the response and renders the content, which may include HTML, CSS, JavaScript, images, or other media types.
8. ๐๐ผ๐ป๐ป๐ฒ๐ฐ๐๐ถ๐ผ๐ป ๐๐น๐ผ๐๐๐ฟ๐ฒ: ๐ The TCP connection is closed either by the client or the server, depending on whether it's a persistent (keep-alive) or non-persistent connection.

๐๐๐๐๐ (๐๐ฒ๐ฉ๐๐ซ๐ญ๐๐ฑ๐ญ ๐๐ซ๐๐ง๐ฌ๐๐๐ซ ๐๐ซ๐จ๐ญ๐จ๐๐จ๐ฅ ๐๐๐๐ฎ๐ซ๐) is an extension of HTTP that adds a layer of encryption and security to the communication between clients and servers.
Here's a overview of how it works:
1. ๐ฆ๐ฆ๐/๐ง๐๐ฆ ๐๐ฎ๐ป๐ฑ๐๐ต๐ฎ๐ธ๐ฒ: ๐ค The process begins with an SSL/TLS (Secure Sockets Layer/Transport Layer Security) handshake, where the client and server establish a secure connection. This involves several steps:
The client sends a "ClientHello" message to the server, indicating supported cryptographic algorithms and other parameters.
The server responds with a "ServerHello" message, selecting a mutually supported cryptographic algorithm and providing its SSL certificate.
The client verifies the server's certificate to ensure it's valid and issued by a trusted Certificate Authority (CA).
If the verification is successful, the client generates a session key, encrypts it with the server's public key (from the certificate), and sends it to the server.
The server decrypts the session key using its private key, establishing a secure connection.
2. ๐๐ป๐ฐ๐ฟ๐๐ฝ๐๐ฒ๐ฑ ๐๐ฎ๐๐ฎ ๐ง๐ฟ๐ฎ๐ป๐๐ณ๐ฒ๐ฟ: ๐ Once the secure connection is established, data exchanged between the client and server is encrypted using symmetric encryption with the session key. This ensures confidentiality and integrity of the transmitted data.
3. ๐๐ง๐ง๐ฃ๐ฆ ๐ฅ๐ฒ๐พ๐๐ฒ๐๐๐ ๐ฎ๐ป๐ฑ ๐ฅ๐ฒ๐๐ฝ๐ผ๐ป๐๐ฒ๐: ๐๐ The client sends HTTPS requests to the server, just like with HTTP. However, the data transmitted over the network is encrypted, preventing eavesdropping or tampering by attackers.
4. ๐ฆ๐ฆ๐/๐ง๐๐ฆ ๐ง๐ฒ๐ฟ๐บ๐ถ๐ป๐ฎ๐๐ถ๐ผ๐ป: ๐ Upon receiving the encrypted data, the server decrypts it using the session key established during the handshake process. The server processes the request and sends the response back to the client over the secure connection.
5. ๐๐ผ๐ป๐ป๐ฒ๐ฐ๐๐ถ๐ผ๐ป ๐๐น๐ผ๐๐๐ฟ๐ฒ: ๐โ Once the communication is complete, the SSL/TLS connection can be terminated. This may happen after a certain period of inactivity or when explicitly closed by either the client or server.
๐๐ง๐ง๐ฃ๐ฆ provides end-to-end encryption, protecting sensitive information such as login credentials, financial transactions, and personal data exchanged between clients and servers. It's widely used for securing web browsing, online banking, e-commerce transactions, and other sensitive communications over the internet.
Conclusion:
๐๐ง๐ง๐ฃ is a stateless protocol, meaning each request-response cycle is independent of previous ones. To maintain state across multiple requests, mechanisms like cookies or sessions are often used.
๐๐ง๐ง๐ฃ๐ฆ(HTTP Secure) provides encryption and authentication to secure data transmission over the web.

| HTTP (Hypertext Transfer Protocol) | HTTPS (Hypertext Transfer Protocol Secure) | |
| Protocol | HTTP is a protocol used for transmitting data between a web server and a web browser. | HTTPS is a secure version of HTTP that uses encryption to protect the data being transmitted. |
| Security | HTTP data is transmitted in plain text. | HTTPS provides encryption and data integrity, making it more secure than HTTP. |
| Port | Typically operates on port 80. | Typically operates on port 443. |
| Usage | Historically, HTTP has been widely used for transmitting web pages, images, and other content on the internet. | HTTPS is used to securely transmit sensitive information such as login credentials, payment details, and personal data. |
| Speed | HTTP is generally faster than HTTPS because it does not involve encryption and decryption processes. | |
| Trust | HTTP does not involve such authentication mechanisms. | HTTPS connections rely on digital certificates issued by trusted Certificate Authorities (CAs) to verify the authenticity of the server. |
| SEO | Google and other search engines prioritize HTTPS websites in search results to encourage web security. |



