Skip to main content

Secure Communication (HTTPS)

Secure communication means the data exchanged between the client and the server is protected while it moves over the network.

In frontend applications, this is mainly done using HTTPS, which uses SSL/TLS certificates to make communication safer.

Client Browser -> HTTPS Request -> Server
Client Browser <- Encrypted HTTPS Response <- Server

The main goal is simple:

No one should easily read, change, or fake the data being exchanged.

One-line idea: HTTPS protects client-server communication by encrypting data, verifying the server, and ensuring data is not changed during transfer.

Core Concepts​

Why It Matters​

When a frontend app communicates with a backend server, sensitive information may travel between them.

Examples:

  • login data
  • session data
  • user profile data
  • payment-related data
  • API response data

Without secure communication, this data can be exposed, modified, or misused.

HTTPS helps with:

AreaWhy It Helps
Data encryptionMakes transferred data unreadable to others
AuthenticationConfirms that the client is talking to the correct server
Data integrityHelps ensure data was not changed during transfer
Data privacyProtects user information from being exposed
Trust and reputationUsers trust websites that use HTTPS
Browser warningsAvoids unsafe-site warnings in modern browsers
Search rankingHTTPS can help with search engine trust signals
Faster loadingHTTPS is commonly used with HTTP/2 for better performance

Core Flow​

User opens website
↓
Browser sends HTTPS request
↓
Server provides SSL/TLS certificate
↓
Browser verifies the certificate
↓
Secure encrypted connection is created
↓
Client and server exchange protected data

Main Security Goals​

HTTPS mainly gives three important security protections.

GoalSimple MeaningHow It Helps
Data EncryptionData becomes unreadable during transferEven if someone sees the network traffic, they cannot easily understand the data
AuthenticationServer identity is verifiedThe browser checks the certificate before trusting the server
Data IntegrityData should not be changed secretlyCryptographic methods/checksums help detect unwanted changes

Data Encryption​

Data encryption means the information sent between client and server is converted into an unreadable format.

Example flow:

Client requests data
↓
Server sends encrypted data
↓
Only the correct client/server communication can read it properly

This protects data while it is moving over the network.

Simple example:

Without HTTPS:
User data may travel in readable form

With HTTPS:
User data travels in encrypted form

Practical Examples​

Authentication​

Authentication in HTTPS means the browser verifies whether the server is genuine.

This is done using an SSL/TLS certificate provided by a trusted authority.

Browser -> asks server for certificate
Server -> sends SSL/TLS certificate
Browser -> verifies certificate
Browser -> trusts the connection if certificate is valid

This helps protect users from connecting to a fake or unsafe server.

Data Integrity​

Data integrity means data should not be altered in an unauthorized way while it is being transferred.

HTTPS uses cryptographic techniques to help verify that the received data is the same data that was sent.

The PDF mentions concepts like:

  • checksum
  • cryptographic methods
  • MAC, meaning Message Authentication Code

Simple idea:

Server sends data + integrity check
↓
Client receives data
↓
Client verifies whether data was changed

If the integrity check fails, it means the data may have been changed or corrupted.

Protection Against Phishing​

HTTPS also helps reduce phishing risk because the browser checks whether the server has a valid certificate.

This does not remove all phishing attacks, but it helps users and browsers identify whether a website connection is secure.

Valid certificate -> browser can trust the secure connection
Invalid certificate -> browser may show a warning

Data Privacy​

HTTPS protects privacy by keeping exchanged data encrypted between the client and server.

This is important because frontend apps often send and receive user-related data through APIs.

User action -> API request -> encrypted communication -> secure response

Compliance and Trust​

Many security standards expect applications to use secure communication.

Using HTTPS improves:

  • user trust
  • product reputation
  • security compliance
  • browser confidence

For users, HTTPS also gives a visible signal that the website is using a secure connection.

Browser Warnings​

Modern browsers warn users when a website is not secure.

HTTP website  -> browser may show "Not Secure"
HTTPS website -> browser shows secure connection indicator

These warnings can reduce user trust, especially on login, payment, or personal-data pages.

Performance Benefit​

The PDF also mentions faster loading with HTTP/2.

In practice, secure communication is commonly used with modern web protocols like HTTP/2, which can improve loading behavior.

HTTPS + HTTP/2 -> safer communication + better loading support

Summary​

HTTPS protects client-server communication by encrypting data, verifying the server, and ensuring data is not changed during transfer.

HTTP  -> data can be exposed or changed easily
HTTPS -> data is encrypted, server is verified, and integrity is protected

Remember it like this:

HTTPS = Encryption + Authentication + Integrity