What is HTTPS and how it works?

HTTPS – Hypertext Transfer Protocol Secure

Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP). It is used for secure communication over a computer network, and is widely used on the Internet.

In HTTPS, the communication protocol is encrypted using Transport Layer Security (TLS) or, formerly, its predecessor, Secure Sockets Layer (SSL). The protocol is therefore also often referred to as HTTP over TLS, or HTTP over SSL.

The principal motivations for HTTPS are authentication of the accessed website, protection of the privacy and integrity of the exchanged data while in transit by creating a secure channel over an insecure network. It protects against man-in-the-middle attacks. The bidirectional encryption of communications between a client and server protects against eavesdropping and tampering of the communication. In practice, this provides a reasonable assurance that one is communicating without interference by attackers with the website that one intended to communicate with, as opposed to an impostor.

The HTTPS Uniform Resource Identifier (URI) scheme has identical usage syntax to the HTTP scheme. However, HTTPS signals the web browser to use an added encryption layer of SSL/TLS to protect the traffic. SSL/TLS is especially suited for HTTP, since it can provide some protection even if only one side of the communication is authenticated. This is the case with HTTP transactions over the Internet, where typically only the server is authenticated (by the client examining the server’s digital certificate).

Web browsers know how to trust HTTPS websites based on certificate authorities (CA) that come pre-installed in their software.

Because HTTPS piggybacks HTTP entirely on top of TLS, the entirety of the underlying HTTP protocol can be encrypted. This includes the request URL, query parameters, headers, and cookies. However, because website addresses and port numbers are necessarily part of the underlying TCP/IP protocols, HTTPS cannot protect their disclosure. In practice this means that even on a correctly configured web server, eavesdroppers can infer the IP address and port number of the web server that one is communicating with, as well as the amount of transferred data and length of session, though not the content of the communication.

The authentication aspect of HTTPS requires a trusted third party to sign server side digital certificates, which historically was expensive. Thus the full authenticated HTTPS connections were more commonly found only on secured payment transaction services, and other secured corporate information systems on the World Wide Web.

In 2016 a non profit organisation, Let’s Encrypt, began to offer free server certificates to all, and a campaign by the Electronic Frontier Foundation (EFF) and support of web browser developers led to the protocol to become more prevalent.

HTTPS is now used more often by web users than the original non-secure HTTP, primarily to protect page authenticity on all types of websites; secure accounts; and to keep user communications, identity, and web browsing private.

HTTPS is especially important over insecure networks (such as public Wi-Fi access points), as anyone on the same local network can packet-sniff and discover sensitive information not protected by HTTPS. Additionally, many free to use and paid WLAN networks engage in packet injection in order to serve their own ads on webpages. However, this can be exploited maliciously in many ways, such as injecting malware onto webpages and stealing users’ private information.

HTTPS should not be confused with the little-used Secure HTTP (S-HTTP) specified in RFC 2660.