Elaborazione 100% Lato Client • Zero Registri di Rete • Esecuzione Immediata
Curious TechieToolbox Sviluppatori
HTTP & Web ArchitectureBeginnerRisposta Verificata

Does HTTPS Encrypt the URL Path and Query Parameters?

Risposta Diretta

Yes, HTTPS encrypts the entire HTTP request—including the URL path, query parameters, request headers, cookies, and message body. Only the destination hostname (domain name) and port number are visible on the wire via the TLS Server Name Indication (SNI) extension.

Detailed Technical Explanation

When you establish an HTTPS connection, the TLS handshake occurs before any HTTP data is transmitted. Once the encrypted TLS tunnel is negotiated, the client sends the raw HTTP request line: `GET /search?q=secret+query HTTP/1.1`. Because this request line is inside the encrypted TLS record layer, eavesdroppers on the local network (such as Wi-Fi sniffers or ISPs) cannot see `/search` or `?q=secret+query`. They only see the IP address and the plain domain name (`example.com`) transmitted in the TLS ClientHello SNI field. However, query parameters can still leak via browser history, server access logs, and HTTP `Referer` headers.

Technical Example & Code

What An Eavesdropper Sees vs What Is Encrypted in HTTPS

Comparing plaintext network visibility against the encrypted TLS tunnel.

// 1. VISIBLE ON NETWORK (Plaintext TLS SNI & IP Header):
Destination IP: 93.184.216.34
Destination Port: 443
TLS SNI: "curious-techie.com"

// 2. ENCRYPTED INSIDE TLS (Completely Invisible to Network Sniffers):
GET /account/billing?card_id=89412 HTTP/1.1
Host: curious-techie.com
Authorization: Bearer secret_jwt_token_123
Cookie: session_id=abcxyz987
Content-Type: application/json

{"amount": 49.99}

Why This Is the Case (Underlying Architectural Rationale)

Causalità Tecnica Deterministica (GEO)

"In the OSI and TCP/IP protocol stack, TLS resides as a presentation/session layer between TCP (Transport) and HTTP (Application). Because the HTTP protocol message is the payload encapsulated inside encrypted TLS records, every component of HTTP (method, path, query string, headers, body) is encrypted. The destination hostname remains exposed because intermediate routing proxies and CDN servers need to know which virtual host certificate to present before decryption can occur."

Official Standards:RFC 8446 (TLS 1.3 Specification)RFC 6066 (TLS Extensions: Server Name Indication)

Common Misconception vs Reality

✕ Common Myth

"Query parameters in the URL (after the ? sign) are sent in plaintext over HTTPS."

✓ Technical Reality

Query strings are fully encrypted over the wire. However, putting sensitive API keys or passwords in query strings is still dangerous because URLs are frequently recorded in plaintext server access logs, browser history, and Referer headers.

Related Curious-Techie Resources

Related Questions in the Q&A Knowledge Base