2016-11-10 20:18:13 +00:00
|
|
|
# Nomad Test Certificate
|
|
|
|
|
2021-08-13 09:09:40 +00:00
|
|
|
Using [cfssl 1.6.0](https://github.com/cloudflare/cfssl)
|
2016-11-10 20:18:13 +00:00
|
|
|
|
|
|
|
| File | Description |
|
|
|
|
|---------------------|---------------------------|
|
|
|
|
| `ca.pem` | CA certificate |
|
|
|
|
| `ca-key.pem` | CA Key |
|
|
|
|
| `nomad-foo.pem` | Nomad cert for foo region |
|
|
|
|
| `nomad-foo-key.pem` | Nomad key for foo region |
|
|
|
|
| `ca-bad.pem` | CA cert for bad region |
|
|
|
|
| `ca-key-bad.pem` | CA key for bad region |
|
|
|
|
| `nomad-bad.pem` | Nomad cert for bad region |
|
|
|
|
| `nomad-bad-key.pem` | Nomad key for bad region |
|
2018-09-06 00:06:30 +00:00
|
|
|
| `global-*.pem` | For global region |
|
2016-11-10 20:18:13 +00:00
|
|
|
|
|
|
|
## Generating self-signed certs
|
|
|
|
```sh
|
2021-08-13 09:09:40 +00:00
|
|
|
# Write defaults and update.
|
|
|
|
# NOTE: this doesn't need to be run if regenerating old certificates and
|
|
|
|
# shouldn't as it overrides non-default values.
|
2016-11-10 20:18:13 +00:00
|
|
|
cfssl print-defaults csr > ca-csr.json
|
2021-08-13 09:09:40 +00:00
|
|
|
cfssl print-defaults csr > ca-bad-csr.json
|
2016-11-11 00:58:53 +00:00
|
|
|
cfssl print-defaults config > ca-config.json
|
2016-11-10 20:18:13 +00:00
|
|
|
|
2021-08-13 09:09:40 +00:00
|
|
|
# Generate CA certificates and keys.
|
|
|
|
#
|
|
|
|
# 1. Generates ca.csr, ca.pem, and ca-key.pem.
|
|
|
|
# 2. Generates ca-bad.csr, ca-bad.pem, and ca-bad-key.pem.
|
|
|
|
cfssl gencert -loglevel=5 -config ca-config.json -initca ca-csr.json | cfssljson -bare ca -
|
|
|
|
cfssl gencert -loglevel=5 -config ca-config.json -initca ca-bad-csr.json | cfssljson -bare ca-bad -
|
2016-11-10 20:18:13 +00:00
|
|
|
|
2021-08-13 09:09:40 +00:00
|
|
|
# Generate certificates and keys.
|
|
|
|
#
|
|
|
|
# 1. Generates nomad-foo.csr, nomad-foo.pem, and nomad-foo-key.pem.
|
|
|
|
# 1. Generates nomad-bad.csr, nomad-bad.pem, and nomad-bad-key.pem.
|
|
|
|
cfssl gencert -loglevel=5 -ca ca.pem -ca-key ca-key.pem -config ca-config.json nomad-foo-csr.json | cfssljson -bare nomad-foo
|
|
|
|
cfssl gencert -loglevel=5 -ca ca-bad.pem -ca-key ca-bad-key.pem -config ca-config.json nomad-bad-csr.json | cfssljson -bare nomad-bad
|
2016-11-10 20:18:13 +00:00
|
|
|
```
|