Skip to content

certs: fix self-signed cert guidance in CDH example config#1569

Open
nogunix wants to merge 1 commit into
confidential-containers:mainfrom
nogunix:fix/cdh-selfsigned-cert-docs
Open

certs: fix self-signed cert guidance in CDH example config#1569
nogunix wants to merge 1 commit into
confidential-containers:mainfrom
nogunix:fix/cdh-selfsigned-cert-docs

Conversation

@nogunix

@nogunix nogunix commented Jul 19, 2026

Copy link
Copy Markdown

What this does

Corrects the self-signed certificate guidance in
confidential-data-hub/example.config.toml. The comment stated that a
self-signed certificate must have the basicConstraints CA:true extension,
but rustls (the default TLS backend) does the opposite: it rejects a
CA:true certificate when it is presented as a leaf (end-entity), failing
with a CaUsedAsEndEntity error.

Why

A self-signed certificate added via extra_root_certificates (or an
image_pull_proxy certificate) becomes both the trust anchor and the leaf
presented during the TLS handshake. webpki validates the leaf and rejects
CA:true in the end-entity position, so the current guidance leads users to
create certificates that fail the handshake.

Verification

Reproduced end-to-end with a tokio-rustls server + reqwest (rustls) client,
using the same cert as both trust anchor and leaf, on
rustls 0.23.42 / rustls-webpki 0.103.13 / reqwest 0.12.28:

  • basicConstraints CA:true self-signed leaf → REJECTED (CaUsedAsEndEntity)
  • basicConstraints CA:false self-signed leaf → ACCEPTED (HTTP 200)

Change

Fixes the extra_root_certificates and image_pull_proxy comment blocks to
state that a self-signed cert must not have CA:true, and to point at the
recommended alternative (a CA:true CA cert signing a separate CA:false
server cert).

The comment stated that a self-signed certificate must have the
basicConstraints CA:true extension, but rustls (the default TLS backend)
does the opposite: it rejects a CA:true certificate presented as a leaf
with a CaUsedAsEndEntity error. A self-signed cert must therefore use
CA:false (or a proper CA:true cert signing a separate CA:false server
cert).

Verified against rustls 0.23.42 / rustls-webpki 0.103.13 / reqwest
0.12.28: a CA:true self-signed leaf is rejected (CaUsedAsEndEntity),
while CA:false is accepted. Fix both the extra_root_certificates and
image_pull_proxy comment blocks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Nogunix <nogunix@gmail.com>
@nogunix
nogunix requested a review from a team as a code owner July 19, 2026 18:23
@mythi

mythi commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@bpradipt PTAL? (ref a3eb154)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants