База знаний

Enable HSTS and choose its duration

Эта статья есть на вашем языке: Как включить HSTS и выбрать срок действия

HSTS tells a browser to use HTTPS for a hostname during a specified period. The browser remembers the policy after receiving it over a secure connection. It is separate from HTTP-to-HTTPS redirection.

Before enabling HSTS, verify reliable HTTPS, a valid certificate and a working renewal process. Substitute your domain for example.com. Avoid a long policy if you plan to return visitors to HTTP.

Configure HSTS

  1. Open WebShield → Manage project → Manage site → Site protect SSL. The section requires free or custom SSL in your service.
  2. Find HSTS and enable its switch.
  3. In HSTS max age, choose 1 день (one day), 1 месяц (one month) or 1 год (one year). These option labels remain in Russian. If previously unset, the default is one year. For an initial trial, immediately select one day.
  4. Wait for both changes to save. Reload the page and check the switch and duration.
  5. After application, run curl.exe -I https://example.com/ on Windows or curl -I https://example.com/ elsewhere. Find Strict-Transport-Security and check max-age: respectively 86400, 2592000 or 31536000 seconds.

HSTS enabled with a one-day max age

The switch and duration save separately. The actual response header confirms the applied policy. Test a short duration before increasing it. The form has no includeSubDomains or preload-registration controls; inspect the website's actual headers.

Stop using HSTS

Disable the switch and inspect the responses. This does not guarantee immediate removal of a policy already saved by visitors' browsers. A browser can require HTTPS until the stored policy expires. A max-age=0 header received over HTTPS removes that policy; the form has no separate control for this reset (RFC 6797). Arrange any planned move away from HTTPS with support in advance and keep a working certificate available.

Статья была полезна?