2018-12-19 08:22:49 +00:00
|
|
|
---
|
2020-04-07 18:55:19 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: 'Commands: TLS CA Create'
|
2020-04-13 18:40:26 +00:00
|
|
|
sidebar_title: ca
|
2018-12-19 08:22:49 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul TLS CA Create
|
|
|
|
|
|
|
|
Command: `consul tls ca create`
|
|
|
|
|
|
|
|
This command create a self signed CA to be used for Consul TLS setup.
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
Create CA:
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-12-19 08:22:49 +00:00
|
|
|
$ consul tls ca create
|
|
|
|
==> Saved consul-ca.pem
|
|
|
|
==> Saved consul-ca-key.pem
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
2020-04-07 18:55:19 +00:00
|
|
|
|
2018-12-19 08:22:49 +00:00
|
|
|
Usage: `consul tls ca create [filename-prefix] [options]`
|
|
|
|
|
|
|
|
#### TLS CA Create Options
|
|
|
|
|
2020-05-18 17:01:14 +00:00
|
|
|
- `-additional-name-constraint=<value>` - Add name constraints for the CA.
|
|
|
|
Results in rejecting certificates for other DNS than specified. Can be used
|
|
|
|
multiple times. Only used in combination with `-name-constraint`.
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-days=<int>` - Provide number of days the CA is valid for from now on, defaults to 5 years.
|
2020-05-18 17:01:14 +00:00
|
|
|
|
|
|
|
- `-domain=<string>` - Domain of consul cluster. Only used in combination with
|
|
|
|
`-name-constraint`. Defaults to `consul`.
|
|
|
|
|
|
|
|
- `-name-constraint` - Add name constraints for the CA. Results in rejecting
|
|
|
|
certificates for other DNS than specified. If turned on localhost and -domain
|
|
|
|
will be added to the allowed DNS. If the UI is going to be served over HTTPS
|
|
|
|
its DNS has to be added with `-additional-constraint`. It is not possible to
|
|
|
|
add that after the fact! Defaults to false.
|