Skip to content

test(integration): mutual TLS + SASL PLAIN + SASL EXTERNAL coverage - #25

Merged
rigazilla merged 1 commit into
infinispan:mainfrom
rigazilla:integration-coverage-mtls-plain-external
Nov 13, 2026
Merged

rigazilla merged 1 commit into
infinispan:mainfrom
rigazilla:integration-coverage-mtls-plain-external

Conversation

@rigazilla

Copy link
Copy Markdown
Member

What

Docker-backed end-to-end integration tests for three features that previously had unit coverage only, closing the mutual-TLS and non-SCRAM-SASL (all but OAUTHBEARER) integration backlog items.

  • PLAIN — no new infra: infinispan-auth.xml already offers PLAIN alongside the SCRAM family, so PLAIN reuses the existing AuthMechanismRoundTrip fixture. AuthIntegrationTests → 7 cases.
  • Mutual TLS — new MutualTlsIntegrationTest against test-configs/infinispan-mtls.xml (require-ssl-client-auth, client-CA truststore, no SASL): programmatic setTls(cert/key) round-trip, hotrods:// URI with client_cert_file/client_key_file round-trip, and a no-client-cert rejection.
  • EXTERNAL — new ExternalAuthIntegrationTest against test-configs/infinispan-external.xml (mutual-TLS realm + <truststore-realm/> + SASL EXTERNAL): cert-identity round-trip programmatically and via a hotrods:// URI with sasl_mechanism=EXTERNAL.

One parameterized start script (scripts/start_infinispan_mtls.sh [config]) serves both TLS configs; scripts/gen-test-certs.sh now also emits the integration client identity (client.pem/client.key) and the server truststore bundle (client-truststore.pem). New ctest label mutual-tls; the EXTERNAL suite is also labelled auth+tls.

Server-side gotchas (details in docs/DECISIONS.md)

  1. <truststore-realm/> trusts specific client leaf certs, not just the CA. A CA-only PEM truststore worked for the pure-mTLS endpoint but the EXTERNAL endpoint rejected the handshake with tlsv1.3 alert certificate unknown. Matches Infinispan's own harness (CertificateAuthority.exportCertificates stores each leaf). Fix: the committed truststore is a leaf + CA bundle — the leaf satisfies the realm, the CA lets the pure-mTLS trust manager validate the chain.
  2. TLS 1.3 reports a missing required client cert post-handshake. SSL_connect() succeeds; the certificate required alert arrives on the first op. The no-cert test asserts an exception across connect()+op, not at connect().

Authoritative references (per AGENTS.md)

Infinispan server tests AuthenticationCertIT + security/trustrealm.xml + endpoints/auth-tls-external.xml, and the 16.0 server XSD.

Testing

Builds clean under Release -Werror. 284 unit + 107 integration (23 suites); Auth/Tls/MutualTls/ExternalAuth suites verified locally (7/5/3/2 pass).

OAUTHBEARER integration remains deferred (needs a token issuer/realm) and is tracked separately.

Closes #24

🤖 Generated with Claude Code

Add Docker-backed end-to-end tests for three features that previously had unit
coverage only, closing the mutual-TLS and non-SCRAM-SASL (all but OAUTHBEARER)
integration backlog items.

- PLAIN: reuses the existing AuthMechanismRoundTrip fixture (infinispan-auth.xml
  already offers PLAIN); AuthIntegrationTests now 7 cases.
- Mutual TLS: new MutualTlsIntegrationTest against infinispan-mtls.xml
  (require-ssl-client-auth, client-CA truststore, no SASL) — setTls(cert/key) and
  hotrods:// URI round-trips, plus a no-client-cert rejection.
- EXTERNAL: new ExternalAuthIntegrationTest against infinispan-external.xml
  (mutual TLS + <truststore-realm/> + SASL EXTERNAL) — cert-identity round-trip
  programmatically and via a hotrods:// URI with sasl_mechanism=EXTERNAL.

One parameterized start script (start_infinispan_mtls.sh [config]) serves both TLS
configs; gen-test-certs.sh now also emits the integration client identity and the
server truststore bundle (client leaf + CA in client-truststore.pem). New ctest
label mutual-tls; EXTERNAL suite also labelled auth+tls.

Server-side gotchas (see docs/DECISIONS.md): <truststore-realm/> trusts specific
client leaf certs, not just the CA (hence the leaf+CA truststore bundle); and under
TLS 1.3 a missing required client cert surfaces post-handshake, so the no-cert case
asserts across connect()+op rather than at connect().

284 unit + 107 integration (23 suites); Auth/Tls/MutualTls/ExternalAuth suites
verified locally (7/5/3/2 pass).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rigazilla
rigazilla merged commit 54b4dcb into infinispan:main Nov 13, 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.

Integration coverage: mutual TLS + SASL PLAIN + SASL EXTERNAL

1 participant