slackhq/nebula · error

error while parsing ca-key: %s

Error message

error while parsing ca-key: %s

What it means

Wrapping error in signCert: parsing the (unencrypted) CA signing key PEM failed — DecryptAndUnmarshalSigningPrivateKey or the plain unmarshal path returned an error. Means the ca-key file is not valid PEM for a signing key or is corrupt; underlying error included via %s.

Source

Thrown at cmd/nebula-cert/sign.go:172

						return fmt.Errorf("ca-key is encrypted and must be decrypted interactively")
					} else if err != nil {
						return fmt.Errorf("error reading password: %s", err)
					}

					if len(passphrase) > 0 {
						break
					}
				}
				if len(passphrase) == 0 {
					return fmt.Errorf("cannot open encrypted ca-key without passphrase")
				}
			}
			curve, caKey, _, err = cert.DecryptAndUnmarshalSigningPrivateKey(passphrase, rawCAKey)
			if err != nil {
				return fmt.Errorf("error while parsing encrypted ca-key: %s", err)
			}
		} else if err != nil {
			return fmt.Errorf("error while parsing ca-key: %s", err)
		}
	}

	rawCACert, err := readInput("ca-crt", *sf.caCertPath, &claims)
	if err != nil {
		return fmt.Errorf("error while reading ca-crt: %s", err)
	}

	caCert, _, err := cert.UnmarshalCertificateFromPEM(rawCACert)
	if err != nil {
		return fmt.Errorf("error while parsing ca-crt: %s", err)
	}

	if !isP11 {
		if err := caCert.VerifyPrivateKey(curve, caKey); err != nil {
			return fmt.Errorf("refusing to sign, root certificate does not match private key")
		}
	}

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Check the ca-key file contents are a valid Nebula signing key PEM
  2. Regenerate the CA key pair with nebula-cert ca
  3. Ensure the correct file path was passed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/nebula-cert/sign.go:172 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slackhq/nebula@dd8f660c0a (2026-09-03). Data as JSON: /api/errors/a75075729b3acfe2. Report an issue: GitHub.