How HTTPS works:
How HTTPS works: Phase 1: TLS Handshake (Secure Channel Setup) Phase 2: HTTPS Communication (Encrypted Data Transfer) Phase 1: TLS Handshake (Secure Channel Setup) Step 1: Client Hello The browser (client) sends an HTTPS request to the server. It includes: A random number (`client_random`) A list of supported cipher suites (e.g., ECDHE-RSA, ECDHE-ECDSA) TLS version info Step 2: Server Hello The server responds with: Another random number (`server_random`) A selected cipher suite (e.g., ECDHE-RSA, ECDHE-ECDSA) Its digital certificate (contains public key and domain info) Step 3: Certificate Validation (Browser Side) The browser verifies the server certificate: Is it issued by a trusted Certificate Authority (CA)? Is it not expired? Is the domain name correct? If valid → continue. If not → browser shows a "connec...