This guide shows how to use the developer CLI certificate helper to:
cryptography), andpython dev-tools/main.py certificate generatepython dev-tools/main.py certificate generate --helpThe command --help output points to this document.
By default, the script writes:
certs/provider-server.pemcerts/provider-server-key.pemDefault SAN values:
localhost127.0.0.1Linux/macOS:
python3 dev-tools/main.py certificate generate
Windows (cmd or PowerShell):
python dev-tools/main.py certificate generate
python3 dev-tools/main.py certificate generate \
--cert-file certs/provider-server.pem \
--key-file certs/provider-server-key.pem \
--common-name localhost \
--dns-name localhost \
--dns-name provider.local \
--ip-address 127.0.0.1 \
--days 365 \
--force
If dependency auto-install is not desired:
python3 dev-tools/main.py certificate generate --skip-dependency-install
Apply the following values where relevant.
config/opamp.json)Add/update provider.tls:
{
"provider": {
"tls": {
"enabled": true,
"cert_file": "certs/provider-server.pem",
"key_file": "certs/provider-server-key.pem",
"trust_anchor_mode": "none"
}
}
}
Behavior notes:
provider.tls section is missing, provider runs HTTP-only.provider.tls is present and enabled is omitted, TLS defaults to enabled.provider.tls.enabled to false to keep the section but force HTTP-only mode.If you start provider with scripts/run_opamp_server.sh --https or
scripts\\run_opamp_server.cmd --https, the TLS cert/key/trust values are generated/updated automatically.
provider.tls.enabled can be set explicitly, but defaults to enabled when omitted.
Also ensure the consumer URL in the same file uses HTTPS:
{
"consumer": {
"server_url": "https://localhost:8080"
}
}
You can also apply the provider.tls block with the developer CLI:
python3 dev-tools/main.py certificate ensure-provider-config \
--config-file config/opamp.json \
--cert-file certs/provider-server.pem \
--key-file certs/provider-server-key.pem \
--trust-anchor-mode none
consumer/opamp-fluentd.json)Set:
{
"consumer": {
"server_url": "https://localhost:8080"
}
}
A self-signed server certificate is not chained to a public CA. If the consumer is doing strict CA validation, HTTPS validation will fail unless you disable verification or trust that cert/CA explicitly.
For the TLS model documented in docs/tls_https_mtls_revision.md, the impacted client setting is:
{
"consumer": {
"tls": {
"verify_server": false
}
}
}
Use verify_server=false for local development only.
server_url to https://....consumer.tls.verify_server=false).Missing dependency: cryptography
--skip-dependency-install, or install manually:
python -m pip install --upgrade cryptographyserver_url is included in SAN entries (--dns-name, --ip-address).--force to overwrite existing cert/key files.