Skip to content

Generate test keystore in jsptest and multipleApps so HTTPS tests pass standalone#26032

Merged
arjantijms merged 1 commit into
eclipse-ee4j:mainfrom
BalusC:fix-jsptest
May 17, 2026
Merged

Generate test keystore in jsptest and multipleApps so HTTPS tests pass standalone#26032
arjantijms merged 1 commit into
eclipse-ee4j:mainfrom
BalusC:fix-jsptest

Conversation

@BalusC
Copy link
Copy Markdown
Contributor

@BalusC BalusC commented May 14, 2026

Since 6b062d0 ("Removed nonexisting keystore.jks and cacerts.jks", Jun 2025) the embedded GlassFish artifacts no longer ship the s1as keystore. The maven-plugin embedded HTTPS tests therefore have no usable server keypair: SecuritySupport falls back to an empty in-memory KeyStore, JSSE cannot present a certificate for the s1as alias, and the TLS 1.3 handshake aborts with HANDSHAKE_FAILURE. The client (jsptest, multipleApps) sees "Remote host terminated the handshake".

CI masked this for ~10 months because secureWebApp runs first in the shared Maven JVM and its src/test/resources/system.properties sets javax.net.ssl.keyStore to a pre-generated testkeystore.p12 via the embedded plugin's . The system property leaks into the same JVM and rescues every later embedded HTTPS test - but only when they run together. Running jsptest or multipleApps standalone fails.

Fix: give each affected module its own keystore the same way secureWebApp already does it.

  • src/test/resources/system.properties points javax.net.ssl.keyStore and trustStore at target/testkeystore.p12, with property filtering so ${project.build.directory} expands.
  • pom.xml wires the file into the embedded plugin via and pulls in glassfish-jdk-extensions and test-utils as test deps for KeyTool / JUnitSystem.
  • JspTest.createKeyStore() generates a fresh PKCS12 s1as keypair under @BeforeAll, mirroring SecureWebAppTest.createKeyStore.

Supersedes PR #26031, which attempted to fix the same handshake failure by generating an s1as keypair inside EmbeddedGlassFishRuntime at every embedded JVM start. Reviewers pushed back on auto-generating certificates in the runtime: embedded GlassFish should not ship or synthesize a private key, production users are expected to supply their own keystore, and a CN=localhost self-signed cert is worthless anyway. Confining the fix to the test modules that actually need it leaves the runtime untouched and matches the existing convention in secureWebApp.

…s standalone

Since 6b062d0 ("Removed nonexisting keystore.jks and cacerts.jks",
Jun 2025) the embedded GlassFish artifacts no longer ship the s1as
keystore. The maven-plugin embedded HTTPS tests therefore have no
usable server keypair: SecuritySupport falls back to an empty in-memory
KeyStore, JSSE cannot present a certificate for the s1as alias, and the
TLS 1.3 handshake aborts with HANDSHAKE_FAILURE. The client (jsptest,
multipleApps) sees "Remote host terminated the handshake".

CI masked this for ~10 months because secureWebApp runs first in the
shared Maven JVM and its src/test/resources/system.properties sets
javax.net.ssl.keyStore to a pre-generated testkeystore.p12 via the
embedded plugin's <systemPropertiesFile>. The system property leaks
into the same JVM and rescues every later embedded HTTPS test - but
only when they run together. Running jsptest or multipleApps standalone
fails.

Fix: give each affected module its own keystore the same way
secureWebApp already does it.

  - src/test/resources/system.properties points javax.net.ssl.keyStore
    and trustStore at target/testkeystore.p12, with property filtering
    so ${project.build.directory} expands.
  - pom.xml wires the file into the embedded plugin via
    <systemPropertiesFile> and pulls in glassfish-jdk-extensions and
    test-utils as test deps for KeyTool / JUnitSystem.
  - JspTest.createKeyStore() generates a fresh PKCS12 s1as keypair
    under @BeforeAll, mirroring SecureWebAppTest.createKeyStore.

Supersedes PR eclipse-ee4j#26031, which attempted to fix the same handshake failure
by generating an s1as keypair inside EmbeddedGlassFishRuntime at every
embedded JVM start. Reviewers pushed back on auto-generating
certificates in the runtime: embedded GlassFish should not ship or
synthesize a private key, production users are expected to supply their
own keystore, and a CN=localhost self-signed cert is worthless anyway.
Confining the fix to the test modules that actually need it leaves the
runtime untouched and matches the existing convention in secureWebApp.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@arjantijms arjantijms merged commit ca09c99 into eclipse-ee4j:main May 17, 2026
5 checks passed
@BalusC BalusC deleted the fix-jsptest branch May 21, 2026 12:35
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.

3 participants