Skip to content

Commit fda9c2e

Browse files
Fix migration test: CA cert needs cRLSign key usage
Two issues fixed: 1. The synthetic CA cert in integration-compose.sh group 19 was created with `openssl req -x509 -new` without specifying key usage extensions. Go's x509.CreateRevocationList (since Go 1.20) requires the issuer cert to have the cRLSign key usage bit set, causing Revoke() to fail with HTTP 409 and the subsequent status check to show "signed" instead of "revoked". Fix: add an OpenSSL extensions config that includes basicConstraints=CA:TRUE and keyUsage=keyCertSign,cRLSign, matching what a real Puppet Server CA would have. 2. compose-migration.yml test-runner service referenced puppet-ca-integ:latest without a build directive, causing `docker compose build` to skip it and `up` to fail with a pull error. Fix: add build context pointing to Dockerfile.run, consistent with how compose.yml defines the same image. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fc81adc commit fda9c2e

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

compose-migration.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ services:
4646
# 0600 root:root). The test script copies them to a writable temp dir
4747
# before use — same as a real migration where an admin would scp/rsync.
4848
test-runner:
49+
build:
50+
context: .
51+
dockerfile: Dockerfile.run
4952
image: puppet-ca-integ:latest
5053
user: "0:0"
5154
depends_on:

test/integration-compose.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,11 +1704,23 @@ _MIG_PID=""
17041704

17051705
# --- 19a: Build a fake "old Puppet CA" directory with openssl ---
17061706
# Create a CA cert + key the way Puppet Server would have them.
1707+
# The cert must include keyCertSign + cRLSign key usage so that Go's
1708+
# x509.CreateRevocationList accepts it as a valid CRL issuer.
17071709
openssl genrsa -out "$_MIG_OLD/ca_key.pem" 2048 2>/dev/null
1710+
cat > "$_MIG_OLD/ca_ext.cnf" <<CAEXTEOF
1711+
[req]
1712+
distinguished_name = dn
1713+
x509_extensions = v3_ca
1714+
[dn]
1715+
[v3_ca]
1716+
basicConstraints = critical, CA:TRUE
1717+
keyUsage = critical, keyCertSign, cRLSign
1718+
CAEXTEOF
17081719
openssl req -x509 -new \
17091720
-key "$_MIG_OLD/ca_key.pem" \
17101721
-subj "/CN=Puppet CA: migration-test" \
17111722
-days 3650 \
1723+
-config "$_MIG_OLD/ca_ext.cnf" \
17121724
-out "$_MIG_OLD/ca_crt.pem" 2>/dev/null
17131725

17141726
# Create a CRL signed by the old CA.

0 commit comments

Comments
 (0)