[wagon2] 15/18: add updated-jetty-compatibility.patch (reworked jetty-compatibility)

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jun 19 13:54:54 UTC 2017


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

ebourg-guest pushed a commit to branch master
in repository wagon2.

commit f30078764048d5bc5660efb3f4f38efe17cb6e89
Author: tony mancill <tmancill at debian.org>
Date:   Sun May 7 09:37:05 2017 -0700

    add updated-jetty-compatibility.patch (reworked jetty-compatibility)
---
 debian/patches/series                            |   1 +
 debian/patches/updated-jetty-compatibility.patch | 209 +++++++++++++++++++++++
 2 files changed, 210 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 1c8c51f..66d8ee7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ no_mina_sshd.diff
 no_itcould_webdav.diff
 fix_compilation_issues.patch
 network_dependent_test_disabled.patch
+updated-jetty-compatibility.patch
diff --git a/debian/patches/updated-jetty-compatibility.patch b/debian/patches/updated-jetty-compatibility.patch
new file mode 100644
index 0000000..e9e59c3
--- /dev/null
+++ b/debian/patches/updated-jetty-compatibility.patch
@@ -0,0 +1,209 @@
+Description: Upgrade to Jetty 9
+ Reworked from Emmanuel's original jetty-compability.patch, which updated
+ wagon 2.10 from Jetty6 -> Jetty9.  This patch updates wagon 2.12 from
+ Jetty8 -> Jetty9.
+Author: Emmanuel Bourg <ebourg at apache.org>
+Author: tony mancill <tmancill at debian.org>
+Forwarded: no
+Last-Update: 2017-05-07
+
+--- a/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
++++ b/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
+@@ -39,6 +39,7 @@
+ import org.eclipse.jetty.security.HashLoginService;
+ import org.eclipse.jetty.security.SecurityHandler;
+ import org.eclipse.jetty.security.authentication.BasicAuthenticator;
++import org.eclipse.jetty.server.NetworkConnector;
+ import org.eclipse.jetty.server.Request;
+ import org.eclipse.jetty.server.Response;
+ import org.eclipse.jetty.server.Server;
+@@ -121,7 +122,7 @@
+         {
+             return 0;
+         }
+-        return server.getConnectors()[0].getLocalPort();
++        return ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
+     }
+ 
+     protected ServletContextHandler createContext( Server server, File repositoryDirectory )
+@@ -169,7 +170,7 @@
+         server.start();
+ 
+         wagon.connect(
+-            new Repository( "id", getProtocol() + "://localhost:" + server.getConnectors()[0].getLocalPort() ) );
++            new Repository( "id", getProtocol() + "://localhost:" + ((NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
+ 
+         wagon.getToStream( "resource", new ByteArrayOutputStream() );
+ 
+@@ -201,7 +202,7 @@
+         server.start();
+ 
+         wagon.connect(
+-            new Repository( "id", getProtocol() + "://localhost:" + server.getConnectors()[0].getLocalPort() ) );
++            new Repository( "id", getProtocol() + "://localhost:" + ((NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
+ 
+         wagon.getToStream( "resource", new ByteArrayOutputStream() );
+ 
+@@ -222,7 +223,7 @@
+         addConnectors( server );
+         server.start();
+         wagon.connect( new Repository( "id", getProtocol() + "://localhost:"
+-          + server.getConnectors()[0].getLocalPort() ) );
++          + ((NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
+         wagon.getToStream( "resource", new ByteArrayOutputStream() );
+         wagon.disconnect();
+         server.stop();
+@@ -253,7 +254,7 @@
+         addConnectors( server );
+         server.start();
+         wagon.connect( new Repository( "id", getProtocol() + "://localhost:"
+-          + server.getConnectors()[0].getLocalPort() ) );
++          + ((NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
+         wagon.getToStream( "resource", new ByteArrayOutputStream() );
+         wagon.disconnect();
+         server.stop();
+@@ -270,7 +271,7 @@
+ 
+     protected String getRepositoryUrl( Server server )
+     {
+-        int localPort = server.getConnectors()[0].getLocalPort();
++        int localPort = ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
+         return getProtocol() + "://localhost:" + localPort;
+     }
+ 
+@@ -685,7 +686,7 @@
+             protocol = "https";
+         }
+ 
+-        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
++        String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) realServer.getConnectors()[0]).getLocalPort();
+ 
+         RedirectHandler redirectHandler =
+             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, redirectUrl, null );
+@@ -751,7 +752,7 @@
+             protocol = "https";
+         }
+ 
+-        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
++        String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) realServer.getConnectors()[0]).getLocalPort();
+ 
+         RedirectHandler redirectHandler =
+             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, redirectUrl, null );
+@@ -819,7 +820,7 @@
+             protocol = "https";
+         }
+ 
+-        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
++        String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) realServer.getConnectors()[0]).getLocalPort();
+ 
+         RedirectHandler redirectHandler =
+             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, redirectUrl, repositoryDirectory );
+@@ -998,7 +999,7 @@
+             protocol = "https";
+         }
+ 
+-        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
++        String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) realServer.getConnectors()[0]).getLocalPort();
+ 
+         RedirectHandler redirectHandler =
+             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, redirectUrl, repositoryDirectory );
+@@ -1174,7 +1175,7 @@
+ 
+         proxyServer.start();
+ 
+-        proxyInfo.setPort( proxyServer.getConnectors()[0].getLocalPort() );
++        proxyInfo.setPort( ((NetworkConnector) proxyServer.getConnectors()[0]).getLocalPort() );
+ 
+         System.out.println(
+             "start proxy on host/port " + proxyInfo.getHost() + "/" + proxyInfo.getPort() + " with non proxyHosts "
+@@ -1232,7 +1233,7 @@
+ 
+         proxyServer.start();
+ 
+-        proxyInfoProvider.getProxyInfo( null ).setPort( proxyServer.getConnectors()[0].getLocalPort() );
++        proxyInfoProvider.getProxyInfo( null ).setPort( ((NetworkConnector) proxyServer.getConnectors()[0]).getLocalPort() );
+ 
+         System.out.println( "start proxy on host/port " + proxyInfoProvider.getProxyInfo( null ).getHost() + "/"
+                                 + proxyInfoProvider.getProxyInfo( null ).getPort() + " with non proxyHosts "
+--- a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java
++++ b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java
+@@ -21,21 +21,26 @@
+ 
+ import org.eclipse.jetty.server.Connector;
+ import org.eclipse.jetty.server.Handler;
++import org.eclipse.jetty.server.HttpConfiguration;
++import org.eclipse.jetty.server.HttpConnectionFactory;
++import org.eclipse.jetty.server.SecureRequestCustomizer;
++import org.eclipse.jetty.server.NetworkConnector;
+ import org.eclipse.jetty.server.Server;
++import org.eclipse.jetty.server.ServerConnector;
++import org.eclipse.jetty.server.SslConnectionFactory;
+ import org.eclipse.jetty.server.handler.DefaultHandler;
+ import org.eclipse.jetty.server.handler.HandlerCollection;
+-import org.eclipse.jetty.server.nio.SelectChannelConnector;
+ import org.eclipse.jetty.server.session.AbstractSessionManager;
+ import org.eclipse.jetty.server.session.SessionHandler;
+ import org.eclipse.jetty.security.ConstraintMapping;
+ import org.eclipse.jetty.security.ConstraintSecurityHandler;
+ import org.eclipse.jetty.security.HashLoginService;
+-import org.eclipse.jetty.server.ssl.SslSocketConnector;
+ import org.eclipse.jetty.servlet.FilterHolder;
+ import org.eclipse.jetty.servlet.FilterMapping;
+ import org.eclipse.jetty.servlet.ServletHolder;
+ import org.eclipse.jetty.util.security.Constraint;
+ import org.eclipse.jetty.util.security.Password;
++import org.eclipse.jetty.util.ssl.SslContextFactory;
+ import org.eclipse.jetty.webapp.WebAppContext;
+ 
+ import javax.servlet.Filter;
+@@ -84,24 +89,34 @@
+         server = new Server();
+         if ( ssl )
+         {
+-            SslSocketConnector connector = new SslSocketConnector();
+             String keystore = getResource( SERVER_SSL_KEYSTORE_RESOURCE_PATH ).getAbsolutePath();
+ 
+             LoggerFactory.getLogger( ServerFixture.class ).info( "TCK Keystore path: " + keystore );
+             System.setProperty( "javax.net.ssl.keyStore", keystore );
+             System.setProperty( "javax.net.ssl.trustStore", keystore );
+ 
+-            // connector.setHost( SERVER_HOST );
+-            //connector.setPort( port );
+-            connector.setKeystore( keystore );
+-            connector.setPassword( SERVER_SSL_KEYSTORE_PASSWORD );
+-            connector.setKeyPassword( SERVER_SSL_KEYSTORE_PASSWORD );
++            SslContextFactory sslContextFactory = new SslContextFactory();
++            sslContextFactory.setKeyStorePath( keystore );
++            sslContextFactory.setKeyStorePassword( SERVER_SSL_KEYSTORE_PASSWORD );
++            sslContextFactory.setKeyManagerPassword( SERVER_SSL_KEYSTORE_PASSWORD );
++
++            HttpConfiguration http_config = new HttpConfiguration();
++            http_config.setSecureScheme( "https" );
++            http_config.setSecurePort( 443 );
++
++            HttpConfiguration https_config = new HttpConfiguration( http_config );
++            https_config.addCustomizer( new SecureRequestCustomizer() );
++
++            ServerConnector connector = new ServerConnector(server,
++                new SslConnectionFactory( sslContextFactory, "http/1.1" ),
++                new HttpConnectionFactory( https_config ));
++            connector.setPort( 443 );
+ 
+             server.addConnector( connector );
+         }
+         else
+         {
+-            Connector connector = new SelectChannelConnector();
++            ServerConnector connector = new ServerConnector( server );
+             connector.setHost( "localhost" );
+             //connector.setPort( port );
+             server.addConnector( connector );
+@@ -204,7 +219,7 @@
+         {
+             throw new IllegalStateException( "Server didn't start in: " + total + "ms." );
+         }
+-        this.httpPort = server.getConnectors()[0].getLocalPort();
++        this.httpPort = ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
+     }
+ 
+     public int getHttpPort()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/wagon2.git



More information about the pkg-java-commits mailing list