[java-shib-shared] branch main updated: Add http/https capability to Jetty testing class.

Codeberg noreply at shibboleth.net
Wed Jul 8 22:08:08 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-shib-shared.

View the commit online:
https://codeberg.org/Shibboleth/java-shib-shared/commit/756ed38db73579db7f144ac5d441ad966f4e7c31

The following commit(s) were added to refs/heads/main by this push:
     new 756ed38d Add http/https capability to Jetty testing class.
756ed38d is described below

commit 756ed38db73579db7f144ac5d441ad966f4e7c31
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Wed Jul 8 18:07:54 2026 -0400

    Add http/https capability to Jetty testing class.
---
 .../shibboleth/shared/testing/EmbeddedJetty.java   | 28 ++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/shib-testing/src/main/java/net/shibboleth/shared/testing/EmbeddedJetty.java b/shib-testing/src/main/java/net/shibboleth/shared/testing/EmbeddedJetty.java
index cd7c88f4..6506f302 100644
--- a/shib-testing/src/main/java/net/shibboleth/shared/testing/EmbeddedJetty.java
+++ b/shib-testing/src/main/java/net/shibboleth/shared/testing/EmbeddedJetty.java
@@ -57,11 +57,25 @@ public class EmbeddedJetty implements Closeable {
     /** Addresses to listen on. */
     private List<InetAddress> jettyListenAddrs;
     
+    /** Non-TLS port */
+    private int port = 8080;
+    
     /** TLS port */
-    private int port = 8443;
+    private int securePort = 8443;
     
     /** Captures server. */
     @Nullable Server jettyServer;
+
+    /**
+     * Sets the non-TLS port to listen on.
+     * 
+     * <p>Defaults to 8080.</p>
+     * 
+     * @param p port
+     */
+    public void setPort(final int p) {
+        port = p;
+    }
     
     /**
      * Sets the TLS port to listen on.
@@ -70,8 +84,8 @@ public class EmbeddedJetty implements Closeable {
      * 
      * @param p port
      */
-    public void setPort(final int p) {
-        port = p;
+    public void setSecurePort(final int p) {
+        securePort = p;
     }
     
     /**
@@ -95,10 +109,16 @@ public class EmbeddedJetty implements Closeable {
         resolveListenAddresses();
         ArrayList<ServerConnector> connectors = new ArrayList<>();
         jettyListenAddrs.forEach(addr ->  {
-            final ServerConnector connector = new ServerConnector(server, sslContextFactory);
+            
+            final ServerConnector connector = new ServerConnector(server);
             connector.setHost(addr.getHostAddress());
             connector.setPort(port);
             connectors.add(connector);
+            
+            final ServerConnector tlsConnector = new ServerConnector(server, sslContextFactory);
+            tlsConnector.setHost(addr.getHostAddress());
+            tlsConnector.setPort(securePort);
+            connectors.add(tlsConnector);
         });
         server.setConnectors(connectors.toArray(new Connector[] {}));
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list