DEV Community

Cover image for Differences Between HTTP and HTTPS?
Kareem Zock
Kareem Zock

Posted on

Differences Between HTTP and HTTPS?

HTTPS is HTTP with encryption. The only difference between the two protocols is that HTTPS uses TLS (SSL) to encrypt normal HTTP requests and responses. As a result, HTTPS is far more secure than HTTP. A website that uses HTTP has HTTP :// in its URL, while a website that uses HTTPS has HTTPS ://.

What is HTTP?

HTTP stands for Hypertext Transfer Protocol, and it is a protocol – or a prescribed order and syntax for presenting information – used for transferring data over a network. Most information that is sent over the Internet, including website content and API calls, uses the HTTP protocol. There are two main kinds of HTTP messages: requests and responses.

What is HTTPS?

HTTPS stands for Hypertext Transfer Protocol Secure (also referred to as HTTP over TLS or HTTP over SSL). When you enter https:// in your address bar in front of the domain, it tells the browser to connect over HTTPS. Generally, sites running over HTTPS will have a redirect in place, so even if you type in http://, it will redirect to deliver over a secured connection. HTTPS also uses TCP (Transmission Control Protocol) to send and receive data packets, but it does so over port 443, within a connection encrypted by Transport Layer Security (TLS).

What does a typical HTTP request look like?

An HTTP request is just a series of lines of text that follow the HTTP protocol. A GET request might look like this:

GET /hello.txt HTTP/1.1
User-Agent: curl/7.63.0 libcurl/7.63.0 OpenSSL/1.1.l zlib/1.2.11
Host: www.example.com
Accept-Language: en

This section of the text, generated by the user's browser, gets sent across the Internet. The problem is, it's sent just like this, in plaintext that anyone monitoring the connection can read. (Those who are unfamiliar with the HTTP protocol may find this text hard to understand, but anyone with a baseline knowledge of the protocol's commands and syntax can read it easily.)

This is especially an issue when users submit sensitive data via a website or a web application. This could be a password, a credit card number, or any other data entered into a form, and in HTTP all this data is sent in plaintext for anyone to read. (When a user submits a form, the browser translates this into an HTTP POST request instead of an HTTP GET request.)

Differences between the HTTP and HTTPS

Below are some of the main differences between the HTTP and HTTPS protocols, in no particular order.

Image description

  1. HTTP URL in your browser's address bar is http://, and the HTTPS URL is https://.
  2. HTTP is unsecured while HTTPS is secured.
  3. HTTP sends data over port 80 while HTTPS uses port 443.
  4. HTTP operates at the application layer, while HTTPS operates at the transport layer.
  5. No SSL certificates are required for HTTP; with HTTPS, it is required that you have an SSL certificate and a CA signs it.
  6. HTTP doesn't require domain validation, whereas HTTPS requires at least domain validation and certain certificates even require legal document validation.
  7. There is no encryption in HTTP; with HTTPS, the data is encrypted before sending.

Summary

We highly encourage you to switch over to HTTPS. The TLS negotiation and CPU overhead are now very negligible, and in a lot of tests, we have seen performance improvements when people switch from HTTP to HTTPS, as long as they are running over HTTP/2.

Check the article on Techwebies

Top comments (0)