Skip to content

Commit 79fc5b1

Browse files
authored
update hsts example to use a site that uses 1 year (#244)
1 parent 28f2274 commit 79fc5b1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pages/hsts.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,33 @@ Strict Transport Security was [proposed in 2009](https://lists.w3.org/Archives/P
4040

4141
The basic problem that HSTS solves is that even after a website turns on HTTPS, visitors may still end up trying to connect over plain HTTP. For example:
4242

43-
* When a user types "dccode.gov" into the URL bar, browsers default to using `http://`.
43+
* When a user types "gsa.gov" into the URL bar, browsers default to using `http://`.
4444
* A user may click on an old link that mistakenly uses an `http://` URL.
4545
* A user's network may be hostile and actively rewrite `https://` links to `http://`.
4646

4747
Websites that prefer HTTPS will generally still listen for connections over HTTP in order to redirect the user to the HTTPS URL. For example:
4848

4949
```
50-
$ curl --head http://www.facebook.com
50+
$ curl --head http://github.com
5151
5252
HTTP/1.1 301 Moved Permanently
53-
Location: https://www.facebook.com/
53+
Location: https://github.com/
5454
```
5555

5656
**This redirect is insecure** and is an opportunity for an attacker to capture information about the visitor (such as cookies from a previous secure session), or to maliciously redirect the user to a phishing site.
5757

5858
This can be addressed by returning a `Strict-Transport-Security` header whenever the user connects securely. For example:
5959

6060
```
61-
$ curl --head https://www.facebook.com
61+
$ curl --head https://github.com
6262
6363
HTTP/1.1 200 OK
64-
Strict-Transport-Security: max-age=15552000; preload
64+
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
6565
```
6666

67-
This enables HSTS for `www.facebook.com`. While HSTS is in effect, clicking any links to `http://www.facebook.com` will cause the browser to issue a request directly for `https://www.facebook.com`.
67+
This enables HSTS for `github.com`. While HSTS is in effect, clicking any links to `http://github.com` will cause the browser to issue a request directly for `https://github.com`.
6868

69-
In the above example, the browser will remember the HSTS policy for 180 days. The policy is refreshed every time browser sees the header again, so if a user visits `https://www.facebook.com` at least once every 180 days, they'll be indefinitely protected by HSTS.
69+
In the above example, the browser will remember the HSTS policy for 1 year. The policy is refreshed every time browser sees the header again, so if a user visits `https://github.com` at least once every year, they'll be indefinitely protected by HSTS.
7070

7171
## HSTS Preloading
7272

@@ -127,7 +127,7 @@ On **Apache**, you would apply a `Header` directive to always set the HSTS heade
127127
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
128128
```
129129

130-
On **Microsoft systems running IIS** (Internet Information Services), there are no ".htaccess" files to implement custom headers. IIS applications use a central `web.config` file for configuration.
130+
On **Microsoft systems running IIS** (Internet Information Services), there are no ".htaccess" files to implement custom headers. IIS applications use a central `web.config` file for configuration.
131131

132132
For IIS 7.0 and up, the example `web.config` file configuration below will handle secure HTTP to HTTPS redirection with HSTS enabled for HTTPS:
133133

0 commit comments

Comments
 (0)