Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit afd4200

Browse files
committed
[docs] Reorganize information on SSL certificates
The project's top-level `README.md` file contains a good deal of information which may not be relevant to all readers. This risks overwhelming newcomers, and it also discourages referencing the content in more targeted contexts from the project's documentation website. Move the information on SSL certificates from the top-level `README.md` file to the corresponding document within the `tools/certs/` directory. Reference the newly-expanded file from the `docs/` directory so that it is included in the generated website (including the search engine).
1 parent 185cb65 commit afd4200

File tree

4 files changed

+73
-77
lines changed

4 files changed

+73
-77
lines changed

README.md

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -180,76 +180,6 @@ Please make sure git and your text editor do not automatically convert
180180
line endings, as it will cause lint errors. For git, please set
181181
`git config core.autocrlf false` in your working tree.
182182

183-
Certificates
184-
============
185-
186-
By default pre-generated certificates for the web-platform.test domain
187-
are provided in [`tools/certs`](tools/certs). If you wish to generate new
188-
certificates for any reason it's possible to use OpenSSL when starting
189-
the server, or starting a test run, by providing the
190-
`--ssl-type=openssl` argument to the `wpt serve` or `wpt run`
191-
commands.
192-
193-
If you installed OpenSSL in such a way that running `openssl` at a
194-
command line doesn't work, you also need to adjust the path to the
195-
OpenSSL binary. This can be done by adding a section to `config.json`
196-
like:
197-
198-
```
199-
"ssl": {"openssl": {"binary": "/path/to/openssl"}}
200-
```
201-
202-
On Windows using OpenSSL typically requires installing an OpenSSL distribution.
203-
[Shining Light](https://slproweb.com/products/Win32OpenSSL.html)
204-
provide a convenient installer that is known to work, but requires a
205-
little extra setup, i.e.:
206-
207-
Run the installer for Win32_OpenSSL_v1.1.0b (30MB). During installation,
208-
change the default location for where to Copy OpenSSL Dlls from the
209-
System directory to the /bin directory.
210-
211-
After installation, ensure that the path to OpenSSL (typically,
212-
this will be `C:\OpenSSL-Win32\bin`) is in your `%Path%`
213-
[Environment Variable](http://www.computerhope.com/issues/ch000549.htm).
214-
If you forget to do this part, you will most likely see a 'File Not Found'
215-
error when you start wptserve.
216-
217-
Finally, set the path value in the server configuration file to the
218-
default OpenSSL configuration file location. To do this create a file
219-
called `config.json`. Then add the OpenSSL configuration below,
220-
ensuring that the key `ssl/openssl/base_conf_path` has a value that is
221-
the path to the OpenSSL config file (typically this will be
222-
`C:\\OpenSSL-Win32\\bin\\openssl.cfg`):
223-
224-
```
225-
{
226-
"ssl": {
227-
"type": "openssl",
228-
"encrypt_after_connect": false,
229-
"openssl": {
230-
"openssl_binary": "openssl",
231-
"base_path: "_certs",
232-
"force_regenerate": false,
233-
"base_conf_path": "C:\\OpenSSL-Win32\\bin\\openssl.cfg"
234-
},
235-
},
236-
}
237-
```
238-
239-
### Trusting Root CA
240-
241-
To prevent browser SSL warnings when running HTTPS tests locally, the
242-
web-platform-tests Root CA file `cacert.pem` in [tools/certs](tools/certs)
243-
must be added as a trusted certificate in your OS/browser.
244-
245-
**NOTE**: The CA should not be installed in any browser profile used
246-
outside of tests, since it may be used to generate fake
247-
certificates. For browsers that use the OS certificate store, tests
248-
should therefore not be run manually outside a dedicated OS instance
249-
(e.g. a VM). To avoid this problem when running tests in Chrome or
250-
Firefox use `wpt run`, which disables certificate checks and therefore
251-
doesn't require the root CA to be trusted.
252-
253183
Publication
254184
===========
255185

docs/running-tests/from-local-system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ https://web-platform.test:8443/tools/runner/index.html *
104104
This server has all the capabilities of the publicly-deployed version--see
105105
[Running the Tests from the Web](from-web).
106106

107-
\**See [Trusting Root CA](https://github.com/web-platform-tests/wpt/blob/master/README.md#trusting-root-ca)*
107+
\**See [Trusting Root CA](../tools/certs/README.md)*
108108

109109
## Via the command line
110110

docs/running-tests/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from-web
77
from-local-system
88
custom-runner
9+
../tools/certs/README.md
910
```
1011

1112
The simplest way to run the tests is via the public website. More detail on

tools/certs/README.md

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,76 @@
1-
To enable https://web-platform.test:8443/, add cacert.pem to your browser as Certificate Authority.
1+
# WPT Test Certificates
2+
3+
The web-platform-tests project maintains a set of SSL certificates to allow
4+
contributors to execute tests requiring HTTPS locally.
5+
6+
## Trusting Root CA
7+
8+
To prevent browser SSL warnings when running HTTPS tests locally, the
9+
web-platform-tests Root CA file `cacert.pem` in the `tools/certs/` directory
10+
must be added as a trusted certificate in your OS/browser.
211

312
For Firefox, go to about:preferences and search for "certificates".
413

5-
For browsers that use the Certificate Authorities of the underlying OS, such as Chrome and Safari,
6-
you need to adjust the OS. For macOS, go to Keychain Access and add the certificate under
7-
**login**.
14+
For browsers that use the Certificate Authorities of the underlying OS, such as
15+
Chrome and Safari, you need to adjust the OS. For macOS, go to Keychain Access
16+
and add the certificate under **login**.
17+
18+
**NOTE**: The CA should not be installed in any browser profile used
19+
outside of tests, since it may be used to generate fake
20+
certificates. For browsers that use the OS certificate store, tests
21+
should therefore not be run manually outside a dedicated OS instance
22+
(e.g. a VM). To avoid this problem when running tests in Chrome or
23+
Firefox use `wpt run`, which disables certificate checks and therefore
24+
doesn't require the root CA to be trusted.
25+
26+
## Regenerating certificates
27+
28+
If you wish to generate new certificates for any reason it's possible to use
29+
OpenSSL when starting the server, or starting a test run, by providing the
30+
`--ssl-type=openssl` argument to the `wpt serve` or `wpt run` commands.
31+
32+
If you installed OpenSSL in such a way that running `openssl` at a
33+
command line doesn't work, you also need to adjust the path to the
34+
OpenSSL binary. This can be done by adding a section to `config.json`
35+
like:
36+
37+
```
38+
"ssl": {"openssl": {"binary": "/path/to/openssl"}}
39+
```
40+
41+
On Windows using OpenSSL typically requires installing an OpenSSL distribution.
42+
[Shining Light](https://slproweb.com/products/Win32OpenSSL.html)
43+
provide a convenient installer that is known to work, but requires a
44+
little extra setup, i.e.:
45+
46+
Run the installer for Win32_OpenSSL_v1.1.0b (30MB). During installation,
47+
change the default location for where to Copy OpenSSL Dlls from the
48+
System directory to the /bin directory.
49+
50+
After installation, ensure that the path to OpenSSL (typically,
51+
this will be `C:\OpenSSL-Win32\bin`) is in your `%Path%`
52+
[Environment Variable](http://www.computerhope.com/issues/ch000549.htm).
53+
If you forget to do this part, you will most likely see a 'File Not Found'
54+
error when you start wptserve.
855

9-
### Updating these certs
56+
Finally, set the path value in the server configuration file to the
57+
default OpenSSL configuration file location. To do this create a file
58+
called `config.json`. Then add the OpenSSL configuration below,
59+
ensuring that the key `ssl/openssl/base_conf_path` has a value that is
60+
the path to the OpenSSL config file (typically this will be
61+
`C:\\OpenSSL-Win32\\bin\\openssl.cfg`):
1062

11-
From the root, run `./wpt serve --config tools/certs/config.json` and terminate it after it has started up.
63+
```
64+
{
65+
"ssl": {
66+
"type": "openssl",
67+
"encrypt_after_connect": false,
68+
"openssl": {
69+
"openssl_binary": "openssl",
70+
"base_path: "_certs",
71+
"force_regenerate": false,
72+
"base_conf_path": "C:\\OpenSSL-Win32\\bin\\openssl.cfg"
73+
},
74+
},
75+
}
76+
```

0 commit comments

Comments
 (0)