Skip to content

feat(tls): mutual TLS (PEM client cert/key) + PEM-honest URI keys (#18) - #20

Merged
rigazilla merged 1 commit into
infinispan:mainfrom
rigazilla:feat/mutual-tls-pem-uri-keys
Nov 12, 2026
Merged

rigazilla merged 1 commit into
infinispan:mainfrom
rigazilla:feat/mutual-tls-pem-uri-keys

Conversation

@rigazilla

@rigazilla rigazilla commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds client-certificate (mutual TLS) support and removes the trust-store URI key ambiguity, staying PEM-only (no JKS/PKCS12).

Mutual TLS

  • TlsConfig gains cert_file / key_file / key_password (all PEM).
  • Connection::startTls loads the client cert chain + private key (SSL_CTX_use_certificate_chain_file / use_PrivateKey_file / check_private_key) and supplies the key passphrase via a passwd callback so an encrypted key never blocks on a terminal prompt. Cert and key must be set together (fail-fast otherwise).

PEM-honest URI keys

  • trust_store_file_name → ca_file; new client_cert_file / client_key_file / client_key_password.
  • The Java keystore keys (trust_store_*, key_store_*, key_alias) are now rejected with a redirect to the PEM equivalent instead of a generic "not supported yet", so a ported Java URI fails fast with the exact fix rather than silently misreading a .jks as PEM.
  • ⚠️ Deliberate backward-compat break on the shipped TLS transport: server-authenticated TLS (PEM) for hotrods:// #18 key trust_store_file_name; recorded as a superseding entry in docs/DECISIONS.md.

Tests & fixtures

  • 266 unit tests pass (was 250): +4 mutual-TLS cases (success, missing-cert rejection, cert-without-key, cert/key mismatch) plus URI parse/redirect cases.
  • New PEM client fixtures (client.pem / client.key / clientca.pem); gen-test-certs.sh extended to reproduce them. TlsIntegrationTest URI updated to ca_file.
  • Clean build under -Werror, Debug and Release.

Notes

  • TLS 1.3 subtlety: a missing-client-cert rejection surfaces on first I/O, not at connect() (production does a PING/SASL next, so it's caught). Documented; the test asserts across connect() + first I/O.
  • Follow-up: mutual TLS is unit-tested only — the Docker TlsIntegrationTest still needs the server configured to require client certs (tracked in STATUS backlog).
  • EXTERNAL SASL (authenticates via the client cert) is now unblocked by this work but not yet implemented.

Docs updated: STATUS.md, DECISIONS.md, security.adoc, README.md.

🤖 Generated with Claude Code

Closes #21.

…finispan#18)

Add client-certificate (mutual TLS) support and remove the trust-store URI
key ambiguity, staying PEM-only (no JKS/PKCS12).

Mutual TLS:
- TlsConfig gains cert_file / key_file / key_password (all PEM).
- Connection::startTls loads the client cert chain + private key
  (SSL_CTX_use_certificate_chain_file / use_PrivateKey_file / check_private_key)
  and supplies the key passphrase via a passwd callback so an encrypted key
  never blocks on a terminal prompt. Cert and key must be set together.

PEM-honest URI keys:
- trust_store_file_name -> ca_file; new client_cert_file / client_key_file /
  client_key_password.
- The Java keystore keys (trust_store_*, key_store_*, key_alias) are now
  rejected with a redirect to the PEM equivalent instead of a generic
  "not supported yet", so a ported Java URI fails fast with the exact fix
  rather than silently misreading a .jks as PEM. Deliberate backward-compat
  break on the shipped infinispan#18 key.

Tests/fixtures:
- +4 mutual-TLS unit cases (success, missing-cert rejection, cert-without-key,
  cert/key mismatch) and URI parse/redirect cases; 266 unit tests pass.
- New PEM client fixtures (client.pem/client.key/clientca.pem); gen-test-certs.sh
  extended to reproduce them. TlsIntegrationTest URI updated to ca_file.
- TLS 1.3 note: a missing-client-cert rejection surfaces on first I/O, not at
  connect(); the test asserts across connect()+first I/O.

Docs: STATUS.md, DECISIONS.md (superseding entry), security.adoc, README.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rigazilla
rigazilla merged commit 3baa605 into infinispan:main Nov 12, 2026
3 checks passed
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.

TLS transport: mutual TLS (PEM client cert/key) + PEM-honest URI keys

1 participant