Skip to content

Commit 84cf20f

Browse files
Document creating test certificates
1 parent 8b29bc3 commit 84cf20f

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

docs/docs/testcerts.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Test Certificates
2+
3+
To be able to start the SaltyRTC server, you need to specify a TLS key and
4+
certificate. In production you will want to use a certificate signed by a
5+
trusted CA, but for testing purposes, the easiest way is to create a
6+
self-signed certificate.
7+
8+
## Generating a Test Certificate
9+
10+
Use the following command to create such a certificate, valid for `localhost`
11+
during the next 5 years:
12+
13+
$ openssl req \
14+
-newkey rsa:1024 \
15+
-x509 \
16+
-nodes \
17+
-keyout saltyrtc.key \
18+
-new \
19+
-out saltyrtc.crt \
20+
-subj /CN=localhost \
21+
-reqexts SAN \
22+
-extensions SAN \
23+
-config <(cat /etc/ssl/openssl.cnf \
24+
<(printf '[SAN]\nsubjectAltName=DNS:localhost')) \
25+
-sha256 \
26+
-days 1825
27+
28+
## Importing
29+
30+
### Chrome / Chromium
31+
32+
The best way to import this certificate into Chrome is via the command line:
33+
34+
$ certutil -d sql:$HOME/.pki/nssdb \
35+
-A -t "P,," -n saltyrtc-test-ca \
36+
-i saltyrtc.crt
37+
38+
Then make sure to restart your browser (or simply visit `chrome://restart`).
39+
40+
### Firefox
41+
42+
In Firefox the easiest way to add your certificate to the browser is to start
43+
the SaltyRTC server (e.g. on `localhost` port 8765), then to visit the
44+
corresponding URL via https (e.g. `https://localhost:8765`). Then, in the
45+
certificate warning dialog that pops up, choose "Advanced" and add a permanent
46+
exception.

docs/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pages:
1414
- Guide:
1515
- Installing: installing.md
1616
- Usage: usage.md
17+
- Test Certificates: testcerts.md
1718
- About: about.md
1819
theme_dir: theme_overrides
1920
extra_css:

0 commit comments

Comments
 (0)