You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rz...@apache.org on 2026/04/21 09:48:41 UTC

(tomee) branch main updated (3bc27be9fe -> 9da3d2558c)

This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git


    from 3bc27be9fe TOMEE-4601 - Bouncycastle 1.84
     new b021f32ec2 Register tomee-remote and tomee-remote-secpol Arquillian containers for Jakarta Data tests
     new 9da3d2558c Fix websocket-tls-basic-auth example test to pass SSLContext via ClientEndpointConfig

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/test/resources/arquillian.xml              | 31 ++++++++++++++++++++++
 .../superbiz/websockets/WebSocketResourceTest.java | 26 +++++++++++++-----
 2 files changed, 51 insertions(+), 6 deletions(-)


(tomee) 01/02: Register tomee-remote and tomee-remote-secpol Arquillian containers for Jakarta Data tests

Posted by rz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit b021f32ec257ccc969960958f854475a59e4d1d3
Author: Richard Zowalla <rz...@apache.org>
AuthorDate: Tue Apr 21 11:47:57 2026 +0200

    Register tomee-remote and tomee-remote-secpol Arquillian containers for Jakarta Data tests
    
    Under -Pall-adapters the arquillian-tomee-tests parent POM runs four Surefire
    executions (embedded, tomee-remote, tomee-remote-secpol, tomee-remote-plume).
    The data-tests arquillian.xml only declared tomee-embedded, so the three
    remote launches failed at init with 'No container or group found that match
    given qualifier'. Add the missing qualifiers following the config-tests
    pattern; tomee-remote-plume reuses the tomee-remote qualifier.
---
 .../src/test/resources/arquillian.xml              | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-data-tests/src/test/resources/arquillian.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-data-tests/src/test/resources/arquillian.xml
index ad9c884fa6..87d2c1c1c0 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-data-tests/src/test/resources/arquillian.xml
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-data-tests/src/test/resources/arquillian.xml
@@ -31,4 +31,35 @@
       </property>
     </configuration>
   </container>
+  <container qualifier="tomee-remote">
+    <configuration>
+      <property name="httpPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="dir">target/tomee-remote</property>
+      <property name="appWorkingDir">target/arquillian-remote-working-dir</property>
+      <property name="portRange">33001-36000</property>
+      <property name="cleanOnStartUp">true</property>
+      <property name="simpleLog">true</property>
+      <property name="properties">
+        openejb.classloader.forced-load=org.apache.openejb.arquillian.tests
+      </property>
+    </configuration>
+  </container>
+  <container qualifier="tomee-remote-secpol">
+    <configuration>
+      <property name="httpPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="dir">target/tomee-remote</property>
+      <property name="appWorkingDir">target/arquillian-remote-working-dir</property>
+      <property name="portRange">33001-36000</property>
+      <property name="cleanOnStartUp">true</property>
+      <property name="simpleLog">true</property>
+      <property name="properties">
+        openejb.classloader.forced-load=org.apache.openejb.arquillian.tests
+        jakarta.security.jacc.policy.provider=sun.security.provider.PolicyFile
+      </property>
+    </configuration>
+  </container>
 </arquillian>


(tomee) 02/02: Fix websocket-tls-basic-auth example test to pass SSLContext via ClientEndpointConfig

Posted by rz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 9da3d2558cb1ee74719729f3d2ce555b3beccbf3
Author: Richard Zowalla <rz...@apache.org>
AuthorDate: Tue Apr 21 11:48:08 2026 +0200

    Fix websocket-tls-basic-auth example test to pass SSLContext via ClientEndpointConfig
    
    Tomcat 11's WsWebSocketContainer reads jakarta.websocket.ClientEndpointConfig#getSSLContext()
    directly and no longer honours the legacy org.apache.tomcat.websocket.SSL_TRUSTSTORE /
    SSL_TRUSTSTORE_PWD user-properties, so the test was falling back to the JDK default
    truststore and failing the handshake against the example's self-signed cert. Build an
    SSLContext from the bundled keystore.jks and set it via
    ClientEndpointConfig.Builder#sslContext(..).
---
 .../superbiz/websockets/WebSocketResourceTest.java | 26 +++++++++++++++++-----
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/examples/websocket-tls-basic-auth/src/test/java/org/superbiz/websockets/WebSocketResourceTest.java b/examples/websocket-tls-basic-auth/src/test/java/org/superbiz/websockets/WebSocketResourceTest.java
index d904406f84..57fb1bc9d7 100644
--- a/examples/websocket-tls-basic-auth/src/test/java/org/superbiz/websockets/WebSocketResourceTest.java
+++ b/examples/websocket-tls-basic-auth/src/test/java/org/superbiz/websockets/WebSocketResourceTest.java
@@ -33,9 +33,14 @@ import jakarta.websocket.Endpoint;
 import jakarta.websocket.EndpointConfig;
 import jakarta.websocket.MessageHandler.Whole;
 import jakarta.websocket.Session;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
 import java.net.URI;
 import java.net.URL;
+import java.security.KeyStore;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
@@ -106,16 +111,25 @@ public class WebSocketResourceTest {
             }
         };
 
+        // Trust the server's self-signed certificate by building an SSLContext from the bundled
+        // keystore.  Tomcat 11's WsWebSocketContainer reads the SSLContext directly from
+        // ClientEndpointConfig#getSSLContext() and no longer honours the legacy
+        // org.apache.tomcat.websocket.SSL_TRUSTSTORE / SSL_TRUSTSTORE_PWD user-properties.
+        final KeyStore trustStore = KeyStore.getInstance("PKCS12");
+        try (InputStream in = new FileInputStream("src/main/conf/keystore.jks")) {
+            trustStore.load(in, "123456".toCharArray());
+        }
+        final TrustManagerFactory tmf = TrustManagerFactory.getInstance(
+                TrustManagerFactory.getDefaultAlgorithm());
+        tmf.init(trustStore);
+        final SSLContext sslContext = SSLContext.getInstance("TLS");
+        sslContext.init(null, tmf.getTrustManagers(), null);
+
         ClientEndpointConfig authorizationConfiguration = ClientEndpointConfig.Builder.create()
                 .configurator(configurator)
+                .sslContext(sslContext)
                 .build();
 
-        //use same keystore as the server
-        authorizationConfiguration.getUserProperties().put("org.apache.tomcat.websocket.SSL_TRUSTSTORE",
-                "src/main/conf/keystore.jks");
-        authorizationConfiguration.getUserProperties().put("org.apache.tomcat.websocket.SSL_TRUSTSTORE_PWD",
-                "123456");
-
         Session session = ContainerProvider.getWebSocketContainer()
                 .connectToServer(
                         endpoint,