Repository navigation
Description
Summary
dashmate ssl obtain --provider zerossl --force always fails with [FAILED] Attribute value not specified. at the Generate certificate request step. The --force flag is effectively unusable for the ZeroSSL provider.
This is particularly impactful because several of dashmate's own SSL error messages explicitly instruct the user to re-run with --force (e.g. on PRIVATE_KEY_IS_NOT_PRESENT, EXTERNAL_IP_MISMATCH, CSR_FILE_IS_NOT_PRESENT). Users following the tool's own guidance hit a dead end.
Environment
- dashmate
3.0.1(also confirmed present on the currentv3.1-devdefault branch by source inspection — see line refs below) - SSL provider: ZeroSSL
- OS: Ubuntu 24.04
Steps to reproduce
- A node that already has a valid ZeroSSL certificate configured (valid
externalIpand ZeroSSL API key in config). - Run:
dashmate ssl obtain --provider zerossl --config mainnet --force --verbose
Actual behavior
[STARTED] Obtain ZeroSSL certificate
[STARTED] Check if certificate already exists and not expiring soon
[SKIPPED] Check if certificate already exists and not expiring soon
[STARTED] Generate a keypair
[SUCCESS] Generate a keypair
[STARTED] Generate certificate request
[FAILED] Attribute value not specified.
The certificate is not renewed. (--expiration-days N on the same node works fine, which is the clue — see Root cause.)
Expected behavior
--force issues a fresh certificate even when the current one is still valid (that is what the flag documents: "renew even if certificate is valid").
Root cause
In packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js (line numbers against v3.1-dev):
- The first subtask, "Check if certificate already exists and not expiring soon", is skipped entirely under
--force:skip: (ctx) => ctx.force, // ~line 50
- But that subtask's body is the only place
ctx.externalIp(andctx.apiKey,ctx.isCsrFilePresent,ctx.csr) are populated:const { error, data } = await validateZeroSslCertificate(config, ctx.expirationDays); lodash.merge(ctx, data); // ~line 54 -> sets ctx.externalIp, ctx.apiKey, ctx.isCsrFilePresent, ...
- So with
--force,ctx.externalIpandctx.isCsrFilePresentareundefined. The keypair + CSR subtasks then run, because their guard isenabled: (ctx) => !ctx.isCsrFilePresent→!undefined === true:ctx.csr = await generateCsr(ctx.keyPair, ctx.externalIp); // ~line 129-131, ctx.externalIp === undefined
generateCsr(packages/dashmate/src/ssl/zerossl/generateCsr.js) passes the undefined value straight into node-forge's subject:node-forge then throwscsr.setSubject([{ name: 'commonName', value: externalIp }]); // ~line 20-21, value === undefined
Attribute value not specified.
Workaround
Use --expiration-days N (with N greater than the certificate's remaining validity) instead of --force. This keeps the check subtask (so ctx.externalIp etc. are initialized) but still triggers re-issuance via the CERTIFICATE_EXPIRES_SOON path. Verified working.
Suggested fix
Do not skip the ctx-initialization under --force. For example, either:
- Always run
validateZeroSslCertificate+lodash.merge(ctx, data)to populatectx(externalIp / apiKey / isCsrFilePresent / csr), and let--forceonly override the "certificate is still valid → stop" early-return; or - Split the first subtask into (a) an always-run "load SSL context" task and (b) a "short-circuit if certificate already valid" task that is the one skipped by
--force.
Note (possibly a separate issue)
The CLI ssl obtain writes the new bundle.crt but does not reload the gateway — envoy keeps serving the old certificate until the gateway container receives kill -SIGHUP 1. The scheduled-renewal helper does send the SIGHUP (scheduleRenewZeroSslCertificateFactory.js), but the manual CLI path does not, so a successful manual ssl obtain appears to have "no effect" on the served certificate until the operator restarts/HUPs the gateway. It may be worth either documenting this or having the CLI command reload the gateway on success.
This bug was discovered and root-caused by Claude (Anthropic's Claude Code agent) while performing SSL certificate maintenance on a dashmate node, and is filed on behalf of the node operator. Happy to open a PR with the preferred fix shape if a maintainer confirms which approach they'd like.
Activity
fix(dashmate): load ZeroSSL config in force mode
fix(dashmate): load ZeroSSL config in force mode
fix(dashmate): load ZeroSSL config in force mode