Skip to content

bxp-cli tls

Create a key and get a TLS certificate for it.

Usage

Create a new private key, ask the CA for a TLS certificate and write
both to files named after the certificate's name:

  <name>.key   the private key (it never leaves this machine)
  <name>.crt   the certificate, followed by the intermediate certificate

Without --token, your browser opens for a login, and you get a client
certificate in your name. With --token, the token decides whether this
is a client or a server certificate; a server certificate needs --name,
the server's name.

Usage:
  bxp-cli tls [flags]

Examples:
  # a client certificate for yourself, with a login in the browser
  bxp-cli tls

  # a server certificate
  bxp-cli tls --token $TOKEN --name web1.example.com

Flags:
      --authority string   ID of the certificate authority on the server
                           (or BXP_CLI_AUTHORITY; default: the one saved by "bxp-cli trust")
      --ca-url string      address of the BastionXP server, e.g. https://bastionxp.example.com
                           (or BXP_CLI_CA_URL; default: the one saved by "bxp-cli trust")
      --encrypt-key        encrypt the new private key with a passphrase, which is asked
      --force              replace the key and certificate files if they exist
  -h, --help               help for tls
      --key-type string    type of the new key: ecdsa or rsa (default "ecdsa")
      --name stringArray   the server's name, for a server certificate
      --no-browser         do not open the browser for the login; print its address instead
      --out-dir string     directory to write the key and certificate to (default ".")
      --root string        path of the CA's root certificate
                           (or BXP_CLI_ROOT; default: the one saved by "bxp-cli trust")
      --token string       a one-time token (or BXP_CLI_TOKEN). Without one, you log in in your browser

Global Flags:
  -v, --verbose   show each step on stderr (or BXP_CLI_LOG_LEVEL=debug)