TLS certificates¶
bxp tls creates a new private key on this machine, asks the CA for a
certificate for it, and writes both files.
With a token¶
The administrator, on the CA machine:
The requester, on the machine that needs the certificate:
$ bxp tls --token <token> --name web.example.com --name www.example.com
Private key: web.example.com.key
Certificate: web.example.com.crt
Valid until: 2027-02-13 16:28 UTC
| File | What it is |
|---|---|
web.example.com.key |
The private key (PKCS#8 PEM, mode 600). It never left this machine. |
web.example.com.crt |
The certificate followed by the intermediate certificate, ready for a web server. |
The files are named after the first --name, in the current directory
(--out-dir changes where). Existing files are not replaced unless you add
--force.
Names¶
- Repeat
--namefor more names: DNS names, IP addresses or email addresses. - With a token,
--namecan be left out: the certificate is then for all the names the token allows, and the files are named after the first. - Every name requested must be in the token. You may ask for fewer.
- The first name becomes the common name.
- The profile decides which kinds of names are allowed (see Certificate profiles).
Server or client certificate¶
The token decides the profile:
| Token made with | Certificate |
|---|---|
--profile tls-server |
Server authentication (web servers, APIs, databases). |
--profile tls-client |
Client authentication (mutual TLS: users, devices, services). |
--profile <your-profile> |
Whatever your profile defines. |
The request command is the same for all of them.
Lifetime¶
Without --validity, the profile's default applies (24 hours for
tls-server and tls-client). A value above the profile's maximum is refused.
With a login¶
Without --token, the command logs in:
What a person may request after a login depends on the access rules. Admins may request any certificate, as above. Everyone else gets a client certificate for themselves.
A client certificate for yourself¶
After a login, with no token and no --name:
$ bxp tls
Private key: [email protected]
Certificate: [email protected]
Valid until: 2026-12-15 16:28 UTC
- The CA decides the name: yours. The common name is your name as the login reports it, which is also the certificate's email address when it is one. You cannot ask for another name.
- The profile is the login's
x509.cert_profile(defaulttls-client): client authentication, for VPN and mutual TLS. See Each verifier's profile. - The files are named after your name.
Use the certificate¶
Inspect it¶
openssl x509 -in web.example.com.crt -noout -subject -issuer -dates -ext subjectAltName
openssl verify -CAfile root.crt -untrusted web.example.com.crt web.example.com.crt
Renew it¶
Run bxp renew every hour: it renews when a third of the
lifetime is left, with no token.
Behind the command¶
bxp tls makes an ECDSA P-256 key, builds a CSR and sends it to
POST /v1/x509/sign with the token. You can do the same with any tool;
see the HTTP API.