Skip to content

dashmate ssl obtain --force fails with "Attribute value not specified" (--force skips externalIp init, breaking CSR generation) #3803

Closed

Description

@DashBot-0001

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 current v3.1-dev default branch by source inspection — see line refs below)
  • SSL provider: ZeroSSL
  • OS: Ubuntu 24.04

Steps to reproduce

  1. A node that already has a valid ZeroSSL certificate configured (valid externalIp and ZeroSSL API key in config).
  2. 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 (and ctx.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.externalIp and ctx.isCsrFilePresent are undefined. The keypair + CSR subtasks then run, because their guard is enabled: (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:
    csr.setSubject([{ name: 'commonName', value: externalIp }]); // ~line 20-21, value === undefined
    node-forge then throws 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:

  1. Always run validateZeroSslCertificate + lodash.merge(ctx, data) to populate ctx (externalIp / apiKey / isCsrFilePresent / csr), and let --force only override the "certificate is still valid → stop" early-return; or
  2. 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

  1. added 2 commits that reference this issue on Aug 5, 2026
    91431c2
    e910329
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions