Skip to content

tls: self-signed cert is ECDSA P-256 so SCRAM channel binding works - #20

Merged
jaredLunde merged 5 commits into
mainfrom
pg-p256-main
Nov 22, 2026
Merged

jaredLunde merged 5 commits into
mainfrom
pg-p256-main

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

Ed25519 certs have no signature digest, so tls-server-end-point channel binding fails ("could not find digest for NID UNDEF"); libpq could not connect over TLS+SCRAM without channel_binding=disable.

  • generate_cert issues ECDSA P-256/SHA-256 (rcgen PKCS#8 PEM; the Ed25519 v1 re-encoding is gone).
  • Existing Ed25519 cert at boot: ensure_cert re-issues any cert whose signature is not ECDSA-SHA256 (OID check in cert_needs_renewal), once; the next boot sees StillValid, so it is idempotent. Unit test covers it. .user-managed and platform certs are untouched.
  • DESIGN.md and DECISIONS.md (I-001a) updated.

Test lines (AWS spot + Docker, supervisor_with_only_a_verifier_accepts_the_original_password_over_scram, PGCHANNELBINDING=require):

  • Ed25519 (red): psql: error: connection to server at "127.0.0.1", port 5433 failed: could not find digest for NID UNDEF / test result: FAILED. 0 passed; 1 failed
  • P-256 (green): test result: ok. 1 passed; 0 failed

Handshake (supervisor_tls_handshake_cost, n=30, TLS connect minus plain connect, psql-process dominated):

cert delta p50 delta p95
Ed25519 1.93 ms 2.18 ms
P-256 1.89 ms 1.91 ms

No measurable difference.

🤖 Generated with Claude Code

@jaredLunde
jaredLunde merged commit 36be5b1 into main Nov 22, 2026
2 checks passed
@jaredLunde
jaredLunde deleted the pg-p256-main branch November 22, 2026 07:03
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.

1 participant