HTTPS after interruption: a separate state acceptance journal

Correcting CA preflight and accepting working HTTPS after interruption in a separate journal, without another reload or rewriting the original pending operation.

A green server with a lock stands between two journals: one unfinished in orange and one accepted in green.

After an interrupted HTTPS installation, the server may work correctly while its operation journal remains incomplete. Inspection can verify the current result without deciding to accept it as the next automation dependency. I added a separate acceptance protocol for that decision.

I tested it on a new Debian VM after a real reload and a controlled SIGKILL of the installer. The original journal remained pending, its current step one-nginx-reload and its recorded outcome unknown. The verified working state can now be accepted in a new journal while retaining that history.

Correct the CA preflight first

The previous experiment exposed a specific difference: a CA without the required keyUsage passed local Go checks but was rejected by the strict SSL context during HTTPS verification. Local preflight now requires explicit keyCertSign permission. For a reproducible fixture, the CA extension fragment and verification command are:

The required CA extension is described in OpenSSL’s strict verification rules. This change closes the observed case while retaining full verification of the current chain and working HTTPS.

[ca]
basicConstraints = critical,CA:TRUE
keyUsage = critical,keyCertSign,cRLSign
openssl verify -x509_strict -purpose sslserver \
  -CAfile "$CA_FILE" "$CERTIFICATE_FILE"

A test with real certificates confirmed both outcomes: Go and strict OpenSSL accept the correct CA and refuse missing keyUsage. In the complete CLI flow, the bad CA stopped planning before installation. No new plan or server TLS role was created. The private key was never sent to a provider.

Which interrupted state can be accepted

The new protocol requires complete material, verified lower roles and working local HTTPS. It accepts a pending reload step or an interrupted final journal commit after reload was already recorded. Incomplete files, another plan or a changed journal stop the operation.

It rechecks the original plan and SHA256, journal files, firewall policy and actual working state. The new plan retains evidence hashes and metadata. It does not copy the password verifier from the original plan.

A separate plan and approval for the new journal

The ORIGINAL_TLS_FLAGS array contains the previous SSH options, lower references, application profile, TLS and the same firewall selector. It also includes --installation-plan-file and --installation-plan-sha256 for the original TLS plan. The variables below identify private local files and the new plan fingerprint.

The acceptance plan has its own file. After review, its exact SHA256 is supplied to apply. Approval covers a new private journal; TLS files, firewall and services stay unchanged.

deploy-cli host application https-reconcile-plan \
  "${ORIGINAL_TLS_FLAGS[@]}" \
  --plan-file "$ACCEPTANCE_PLAN"
deploy-cli host application https-reconcile-apply \
  "${ORIGINAL_TLS_FLAGS[@]}" \
  --plan-file "$ACCEPTANCE_PLAN" \
  --plan-sha256 "$ACCEPTANCE_PLAN_SHA256" \
  --approve-privileges

After writing the journal, the CLI opens a fresh SSH connection and verifies the same manifest. These are selected checks fields from the actual response: a reduced projection, not the complete raw output.

{
  "acceptance_kind": "existing-verified-state",
  "original_completion_rewritten": "false",
  "creation_provenance": "false",
  "configuration_writes": "0",
  "service_actions": "0"
}

The new journal has its own reference

The next reader receives a private reference with three values: the new plan path, its SHA256 and the manifest of committed acceptance. This is a template; replace the path and hashes with actual values from the run. The file remains private to the operator.

{
  "plan_file": "/ABSOLUTE/PRIVATE/acceptance-plan.json",
  "plan_sha256": "<EXACT_PLAN_SHA256>",
  "manifest_sha256": "<COMMITTED_MANIFEST_SHA256>"
}

Verify checks the new journal against its plan. Inspect additionally consumes this exact plan/SHA/manifest reference. On the fixture, changing the manifest while keeping the plan unchanged caused refusal without writes. This binds a particular completion rather than trusting a filename.

deploy-cli host application https-reconcile-verify \
  "${ORIGINAL_TLS_FLAGS[@]}" \
  --plan-file "$ACCEPTANCE_PLAN" \
  --plan-sha256 "$ACCEPTANCE_PLAN_SHA256"

deploy-cli host application https-reconcile-inspect \
  "${ORIGINAL_TLS_FLAGS[@]}" \
  --reconciliation-file "$ACCEPTANCE_REFERENCE"

What remained on the server

All 46 selected original files remained exact. Only two files for the new private journal were added. All 48 files remained unchanged during standalone verification, apply replay, reference inspection and negative controls.

Systemd recorded only two reloads throughout this fixture cycle: initial private application delivery and the action before SIGKILL. Acceptance and replay performed no new reload. The certificate, key, BasicAuth, configuration and Nginx/PHP-FPM processes were preserved.

The original journal still reports pending/unknown after acceptance. Ordinary original apply refuses with partial. Subsequent automation must explicitly use the new acceptance reference. The frame below summarizes saved experimental results; it is not a new command run.

Summary of saved fixture results: the original journal remained pending, a new journal accepted the verified state, and repeated checks did not change services.

Acceptance does not grant file deletion rights

creation_provenance=false means the new journal accepts an existing verified state. It does not complete the original installation or grant its rollback deletion authority. This is a distinct kind of completion with its own reference.

If writing the new journal is interrupted, its partial state also remains and stops automatic continuation. General repair of damaged journals, interrupted rollback and full clean/existing setup orchestration remain separate stages.

  1. Operations & Security Origin CA: a certificate between Cloudflare and the educational server
  2. Operations & Security Adopting protected HTTPS with the CLI without a restart
  3. Operations & Security First HTTPS installation through CLI: verification and rollback
  4. Operations & Security On-demand E-01 checks: the server, Cloudflare and 20 responses
  5. Operations & Security Interrupted HTTPS installation: why reload is not retried