Skip to content

Commit

Permalink
Document creating test certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
threema-danilo committed Sep 19, 2017
1 parent 8b29bc3 commit c76f3e3
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions docs/docs/testcerts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Test Certificates

To be able to start the SaltyRTC server, you need to specify a TLS key and
certificate. In production you will want to use a certificate signed by a
trusted CA, but for testing purposes, the easiest way is to create a
self-signed certificate.

## Generating a Test Certificate

Use the following command to create such a certificate, valid for `localhost`
during the next 5 years:

$ openssl req \
-newkey rsa:1024 \
-x509 \
-nodes \
-keyout saltyrtc.key \
-new \
-out saltyrtc.crt \
-subj /CN=localhost \
-reqexts SAN \
-extensions SAN \
-config <(cat /etc/ssl/openssl.cnf \
<(printf '[SAN]\nsubjectAltName=DNS:localhost')) \
-sha256 \
-days 1825

## Importing

### Chrome / Chromium

The best way to import this certificate into Chrome is via the command line:

$ certutil -d sql:$HOME/.pki/nssdb \
-A -t "P,," -n saltyrtc-test-ca \
-i saltyrtc.crt

Then make sure to restart your browser (or simply visit `chrome://restart`).

### Firefox

Go to the directory `~/.mozilla/firefox` and look for a directory with a
cryptic name containing the string `.default-`. This is your profile name. Copy
it, then run this command (with the `<profile-name>` replaced):

$ certutil -d ~/.mozilla/firefox/<profile-name> \
-A -n saltyrtc-test-ca -t Ccw,, \
-i saltyrtc.crt
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pages:
- Guide:
- Installing: installing.md
- Usage: usage.md
- Test Certificates: testcerts.md
- About: about.md
theme_dir: theme_overrides
extra_css:
Expand Down

0 comments on commit c76f3e3

Please sign in to comment.