Skip to main content
Mole managing certificates

muti-metroo cert

Certificate management commands.

Subcommands

cert ca

Generate Certificate Authority.

muti-metroo cert ca [-n <name>] [-o <output-dir>] [-d <days>]

Flags:

FlagShortDefaultDescription
--cn-n"Muti Metroo CA"Common name for the CA
--out-o./certsOutput directory
--days-d365Validity period in days

Output:

  • ca.crt: CA certificate
  • ca.key: CA private key (keep secure!)

cert agent

Generate agent/peer certificate. The certificate can be used for both server authentication (listeners) and client authentication (peer connections with mTLS).

muti-metroo cert agent -n <name> [--dns <hostnames>] [--ip <ips>] [-o <output>] [-d <days>]

Flags:

FlagShortDefaultDescription
--cn-n(required)Common name for the certificate
--dnsAdditional DNS names (comma-separated)
--ipAdditional IP addresses (comma-separated)
--out-o./certsOutput directory
--days-d90Validity period in days
--ca./certs/ca.crtCA certificate path
--ca-key./certs/ca.keyCA private key path

Output:

  • <name>.crt: Agent certificate (named after common name)
  • <name>.key: Agent private key

cert client

Generate client-only certificate. This certificate can only be used for client authentication (connecting to listeners), not for server authentication.

muti-metroo cert client -n <name> [-o <output>] [-d <days>]

Flags:

FlagShortDefaultDescription
--cn-n(required)Common name for the certificate
--out-o./certsOutput directory
--days-d90Validity period in days
--ca./certs/ca.crtCA certificate path
--ca-key./certs/ca.keyCA private key path

Output:

  • <name>.crt: Client certificate (named after common name)
  • <name>.key: Client private key

cert info

Display detailed information about a certificate file.

muti-metroo cert info <cert-file>

Example output:

Certificate: ./certs/agent-1.crt

Subject: CN=agent-1,O=Muti Metroo
Issuer: CN=Mesh CA,O=Muti Metroo
Serial: 1a2b3c4d5e6f...
Fingerprint: sha256:ab12cd34...
Is CA: false
Not Before: 2025-01-01T00:00:00Z
Not After: 2025-04-01T00:00:00Z
Status: Valid (89 days left)
DNS Names: agent-1, localhost, agent1.example.com
IP Addresses: 127.0.0.1, ::1, 192.168.1.10
Key Usage: KeyEncipherment, DigitalSignature
Ext Key Usage: ServerAuth, ClientAuth

Examples

# Generate CA
muti-metroo cert ca -n "Mesh CA" -o ./certs

# Generate agent cert (signed by CA)
muti-metroo cert agent -n "agent-1" \
--ca ./certs/ca.crt \
--ca-key ./certs/ca.key \
--dns agent1.example.com \
--ip 192.168.1.10 \
-o ./certs

# Generate client cert (signed by CA)
muti-metroo cert client -n "admin" \
--ca ./certs/ca.crt \
--ca-key ./certs/ca.key \
-o ./certs

# View cert info
muti-metroo cert info ./certs/agent-1.crt
Default Paths

The --ca and --ca-key flags default to ./certs/ca.crt and ./certs/ca.key. If your CA files are there, you can omit these flags.

Certificate Types

TypeCommandServer AuthClient AuthUse Case
CAcert caN/AN/ASign other certificates
Agentcert agentYesYesListeners and peer connections
Clientcert clientNoYesClient-only connections