When an HTTPS connection is set up, the browser and the server first agree on a key and then encrypt all traffic with it. Perfect Forward Secrecy (PFS) describes how that agreement happens. With PFS, a temporary key is created for every session and discarded when the session ends. As a result, even if the server's private key is stolen in the future, previously recorded traffic cannot be decrypted.
The risk: traffic recorded today, decrypted tomorrow
Imagine someone on the network quietly recording encrypted traffic to your site for months. They cannot read it yet. Then one day the private key leaks, perhaps through an old backup or a compromised server. With the old RSA key exchange, each session key was sent encrypted with that very private key, so every recorded session can now be opened one by one.
PFS closes exactly this gap. Ephemeral keys are never written to disk and are not kept after the session, so they cannot be recovered later. The server's long-term key is used only to prove the server's identity by signing, not to encrypt traffic. A stolen key may let an attacker impersonate your site in future connections, but past conversations stay private.
How it works: ECDHE and DHE
PFS comes from the ephemeral variant of the Diffie-Hellman key exchange. In cipher suite names you can spot it as ECDHE (elliptic curves) or DHE (classic). On every connection both sides generate a one-time key pair, exchange the public halves and compute a shared secret that never travels over the wire. Today ECDHE with curves such as X25519 or P-256 is the norm because it is fast and strong; classic DHE is slower and can be weak with poorly chosen small parameters.
TLS 1.3 versus TLS 1.2
TLS 1.3 removed static RSA key exchange entirely, so ordinary certificate-based connections always use ephemeral Diffie-Hellman and PFS is effectively built in. TLS 1.2 depends on configuration: it offers both ECDHE suites and non-PFS suites such as AES256-SHA. Session tickets are another subtle point: if the ticket encryption key is never rotated, anyone who obtains it can decrypt resumed sessions, which weakens PFS. Many administrators disable tickets for TLS 1.2 or rotate their keys regularly.
Example: a clinic website in Tashkent
Suppose a private clinic in Tashkent runs an online appointment form on misol.uz, where patients enter their name, phone number and a short description of their symptoms. That data must stay private for years. If the server still allows RSA key exchange over TLS 1.2, anyone who recorded the traffic could read old submissions on the day the key leaks. Once only ECDHE suites remain and TLS 1.3 is enabled, each patient's connection is protected by its own one-time key, at no extra cost and with no noticeable slowdown.
Checking your server
Force a TLS 1.2 handshake with OpenSSL and look at the negotiated cipher and temporary key:
openssl s_client -connect example.uz:443 -servername example.uz -tls1_2 </dev/null 2>/dev/null | grep -E "Protocol|Cipher|Temp Key"
Output like this means PFS is working:
Server Temp Key: X25519, 253 bits
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES128-GCM-SHA256
To list every cipher the server accepts, use nmap. Any TLS 1.2 suite that does not start with ECDHE or DHE lacks PFS and should be removed:
nmap --script ssl-enum-ciphers -p 443 example.uz
Enabling PFS in Nginx
On a VPS running Nginx, this is a solid starting point: only TLS 1.2 and 1.3, ECDHE-only suites for TLS 1.2, and session tickets turned off. TLS 1.3 suites need no separate setting because the defaults are secure:
server {
listen 443 ssl;
http2 on;
server_name example.uz;
ssl_certificate /etc/letsencrypt/live/example.uz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.uz/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
ssl_session_tickets off;
}
Validate with nginx -t and apply with systemctl reload nginx. Very old devices may fail to connect, but their share is small today. Mozilla's SSL Configuration Generator "Intermediate" profile is a good reference for the exact list.
Who handles this on shared hosting
On shared hosting the provider controls the web server's TLS settings. On sayt.uz hosting, Let's Encrypt certificates are free and renew automatically; you can confirm the certificate is active in the cabinet and run the OpenSSL check above. If you spot a non-PFS cipher, contact support through the sayt.uz cabinet. On a VPS, the configuration is entirely yours to apply.