contact@embeddedgeeks.com
Embedded World

HTTP & HTTPS

HTTP (Hypertext Transfer Protocol)

HTTP is a client-server protocol that allows clients to request web pages from web servers. It is an application-level protocol widely used on the Internet. Clients are usually web browsers. When a user wants to access a web page, a browser sends an HTTP request message to the webserver. The server responds with the requested web page. By default, web servers use the TCP port 80.

Clients and web servers use a request-response method to communicate with each other, with clients sending the HTTP Requests and servers responding with the HTTP Responses. Clients usually send their requests using GET or POST methods, for example, GET /homepage.html. Web servers respond with a status message (200 if the request was successful) and send the requested resource.

An example will clarify this process:

The client wants to access http://google.com and points his browser to the URL http://google.com (this is an example of an HTTP Request message). The web server hosting http://google.com receives the request and responds with the content of the web page (the HTTP response message).

Web servers usually use a well-known TCP port 80. If the port is not specified in a URL, browsers will use this port when sending the HTTP requests. For example, you will get the same result when requesting http://google.com and http://google.com:80.

NOTE
The version of HTTP most commonly used today is HTTP/1.1. A newer version, HTTP/2, is available and supported by the most browsers.

HTTPS (Hypertext Transfer Protocol Secure)

Hypertext Transfer Protocol Secure is a secure version of HTTP. This protocol enables secure communication between a client (e.g. web browser) and a server (e.g. web server) by using encryption. HTTPS uses Transport Layer Security (TLS) protocol or its predecessor Secure Sockets Layer (SSL) for encryption.

HTTPS is commonly used to create a secure channel over some insecure networks, e.g. the Internet. A lot of traffic on the Internet is unencrypted and susceptible to sniffing attacks. HTTPS encrypts sensitive information, which makes a connection secure.

HTTPS URLs begin with https instead of http. In Internet Explorer, you can immediately recognize that a web site is using HTTPS because a lock appears to the right of the address bar:

https ie lock

NOTE
HTTPS uses a well-known TCP port 443. If the port is not specified in a URL, browsers will use this port when sending HTTPS requests. For example, you will get the same result when requesting https://gmail.com and https://gmail.com:443.