[wagon2] 01/01: Transition to Jetty 9
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Tue Oct 25 08:23:19 UTC 2016
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository wagon2.
commit e3dba5099b1480713368caff94d040ad6bf308f3
Author: Emmanuel Bourg <ebourg at apache.org>
Date: Tue Oct 25 10:21:22 2016 +0200
Transition to Jetty 9
---
debian/changelog | 7 +
debian/control | 4 +-
debian/maven.rules | 4 +-
debian/patches/jetty-compatibility.patch | 354 ++++++++++++++++++++++++++++---
4 files changed, 332 insertions(+), 37 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index c7d1acb..db72a52 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+wagon2 (2.10-6) unstable; urgency=medium
+
+ * Team upload.
+ * Transition to Jetty 9
+
+ -- Emmanuel Bourg <ebourg at apache.org> Tue, 25 Oct 2016 10:21:10 +0200
+
wagon2 (2.10-5) unstable; urgency=medium
* Team upload.
diff --git a/debian/control b/debian/control
index d470301..1c60a4c 100644
--- a/debian/control
+++ b/debian/control
@@ -17,8 +17,8 @@ Build-Depends-Indep: default-jdk-doc,
libeasymock-java (>= 3.2),
libhttpclient-java (>= 4.3.1),
libjaxen-java,
- libjetty8-java,
- libjetty8-extra-java,
+ libjetty9-java,
+ libjetty9-extra-java,
libjsoup-java,
libmaven-install-plugin-java,
libmaven-javadoc-plugin-java,
diff --git a/debian/maven.rules b/debian/maven.rules
index bb6321e..96fb758 100644
--- a/debian/maven.rules
+++ b/debian/maven.rules
@@ -45,5 +45,5 @@ org.codehaus.plexus plexus-component-metadata jar s/.*/1.5.5/ * *
org.codehaus.plexus plexus-container-default jar s/1\.0-alpha.*/1.0-alpha/ * *
commons-logging s/commons-logging-api/commons-logging/ * s/.*/debian/ * *
s/easymock/org.easymock/ easymock * s/.*/debian/ * *
-s/org.mortbay.jetty/org.eclipse.jetty/ s/jetty/jetty-webapp/ * s/.*/debian/ * *
-s/org.apache.geronimo.specs/javax.servlet/ s/geronimo-servlet_2.5_spec/servlet-api/ jar s/.*/2.5/ * *
+s/org.mortbay.jetty/org.eclipse.jetty/ s/jetty/jetty-webapp/ * s/.*/9.x/ * *
+s/org.apache.geronimo.specs/javax.servlet/ s/geronimo-servlet_2.5_spec/servlet-api/ jar s/.*/3.1/ * *
diff --git a/debian/patches/jetty-compatibility.patch b/debian/patches/jetty-compatibility.patch
index d315e1c..cdf408b 100644
--- a/debian/patches/jetty-compatibility.patch
+++ b/debian/patches/jetty-compatibility.patch
@@ -1,9 +1,9 @@
-Description: Upgrade to Jetty 8
+Description: Upgrade to Jetty 9
Author: Emmanuel Bourg <ebourg at apache.org>
Forwarded: no
--- 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
-@@ -34,20 +34,22 @@
+@@ -34,20 +34,23 @@
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
@@ -22,6 +22,7 @@ Forwarded: no
-import org.mortbay.jetty.servlet.DefaultServlet;
-import org.mortbay.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.server.Handler;
++import org.eclipse.jetty.server.NetworkConnector;
+import org.eclipse.jetty.server.Request;
+import org.eclipse.jetty.server.Response;
+import org.eclipse.jetty.server.Server;
@@ -40,7 +41,7 @@ Forwarded: no
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
-@@ -99,7 +101,7 @@
+@@ -99,7 +102,7 @@
server = new Server( 0 );
PutHandler putHandler = new PutHandler( repositoryDirectory );
@@ -49,7 +50,14 @@ Forwarded: no
createContext( server, repositoryDirectory );
-@@ -123,7 +125,7 @@
+@@ -117,13 +120,13 @@
+ {
+ return 0;
+ }
+- return server.getConnectors()[0].getLocalPort();
++ return ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
+ }
+
protected void createContext( Server server, File repositoryDirectory )
throws IOException
{
@@ -58,7 +66,52 @@ Forwarded: no
root.setResourceBase( repositoryDirectory.getAbsolutePath() );
ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
root.addServlet( servletHolder, "/*" );
-@@ -309,7 +311,7 @@
+@@ -164,7 +167,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() );
+
+@@ -196,7 +199,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() );
+
+@@ -217,7 +220,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();
+@@ -248,7 +251,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();
+@@ -265,7 +268,7 @@
+
+ protected String getRepositoryUrl( Server server )
+ {
+- int localPort = server.getConnectors()[0].getLocalPort();
++ int localPort = ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
+ return getProtocol() + "://localhost:" + localPort;
+ }
+
+@@ -309,7 +312,7 @@
AbstractHandler handler = new AbstractHandler()
{
@@ -67,7 +120,7 @@ Forwarded: no
throws IOException, ServletException
{
if ( called.get() )
-@@ -456,7 +458,7 @@
+@@ -456,7 +459,7 @@
AbstractHandler handler = new AbstractHandler()
{
@@ -76,7 +129,7 @@ Forwarded: no
throws IOException, ServletException
{
if ( called.get() )
-@@ -543,7 +545,7 @@
+@@ -543,7 +546,7 @@
Server server = new Server( getTestRepositoryPort() );
String localRepositoryPath = FileTestUtils.getTestOutputDir().toString();
@@ -85,7 +138,43 @@ Forwarded: no
root.setResourceBase( localRepositoryPath );
ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
servletHolder.setInitParameter( "gzip", "true" );
-@@ -1122,13 +1124,13 @@
+@@ -679,7 +682,7 @@
+ protocol = "https";
+ }
+
+- String redirectUrl = protocol + "://localhost:" + server.getConnectors()[0].getLocalPort();
++ String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
+
+ RedirectHandler redirectHandler =
+ new RedirectHandler( "Found", HttpServletResponse.SC_SEE_OTHER, redirectUrl, null );
+@@ -744,7 +747,7 @@
+ protocol = "https";
+ }
+
+- String redirectUrl = protocol + "://localhost:" + server.getConnectors()[0].getLocalPort();
++ String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
+
+ RedirectHandler redirectHandler =
+ new RedirectHandler( "Found", HttpServletResponse.SC_SEE_OTHER, redirectUrl, null );
+@@ -811,7 +814,7 @@
+ protocol = "https";
+ }
+
+- String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
++ String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) realServer.getConnectors()[0]).getLocalPort();
+
+ RedirectHandler redirectHandler =
+ new RedirectHandler( "Found", HttpServletResponse.SC_SEE_OTHER, redirectUrl, repositoryDirectory );
+@@ -991,7 +994,7 @@
+ protocol = "https";
+ }
+
+- String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
++ String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) realServer.getConnectors()[0]).getLocalPort();
+
+ RedirectHandler redirectHandler =
+ new RedirectHandler( "Found", HttpServletResponse.SC_SEE_OTHER, redirectUrl, repositoryDirectory );
+@@ -1122,13 +1125,13 @@
this.repositoryDirectory = repositoryDirectory;
}
@@ -101,7 +190,25 @@ Forwarded: no
handlerRequestResponses.add(
new HandlerRequestResponse( req.getMethod(), ( (Response) resp ).getStatus(),
req.getRequestURI() ) );
-@@ -1342,7 +1344,7 @@
+@@ -1158,7 +1161,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 "
+@@ -1216,7 +1219,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 "
+@@ -1342,7 +1345,7 @@
assertEquals( "top secret", IOUtil.toString( in ) );
@@ -110,7 +217,7 @@ Forwarded: no
testPreemptiveAuthenticationGet( securityHandler, supportPreemptiveAuthenticationGet() );
}
-@@ -1393,7 +1395,7 @@
+@@ -1393,7 +1396,7 @@
assertEquals( "top secret", out.toString( "US-ASCII" ) );
@@ -119,7 +226,7 @@ Forwarded: no
testPreemptiveAuthenticationGet( securityHandler, supportPreemptiveAuthenticationGet() );
}
finally
-@@ -1483,9 +1485,9 @@
+@@ -1483,9 +1486,9 @@
SecurityHandler sh = createSecurityHandler();
@@ -131,7 +238,7 @@ Forwarded: no
root.setResourceBase( localRepositoryPath );
ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
root.addServlet( servletHolder, "/*" );
-@@ -1587,7 +1589,7 @@
+@@ -1587,7 +1590,7 @@
AbstractHandler handler = new AbstractHandler()
{
@@ -140,7 +247,7 @@ Forwarded: no
throws IOException, ServletException
{
if ( called.get() )
-@@ -1908,7 +1910,7 @@
+@@ -1908,7 +1911,7 @@
this.status = status;
}
@@ -149,7 +256,7 @@ Forwarded: no
throws IOException, ServletException
{
if ( status != 0 )
-@@ -1968,12 +1970,9 @@
+@@ -1968,12 +1971,9 @@
this.resourceBase = repositoryDirectory;
}
@@ -163,7 +270,7 @@ Forwarded: no
if ( baseRequest.isHandled() || !"PUT".equals( baseRequest.getMethod() ) )
{
return;
-@@ -2017,7 +2016,7 @@
+@@ -2017,7 +2017,7 @@
List<HandlerRequestResponse> handlerRequestResponses = new ArrayList<HandlerRequestResponse>();
@@ -172,7 +279,7 @@ Forwarded: no
throws IOException, ServletException
{
System.out.println( " handle proxy request" );
-@@ -2035,7 +2034,7 @@
+@@ -2035,7 +2035,7 @@
}
handlerRequestResponses.add(
new HandlerRequestResponse( request.getMethod(), HttpServletResponse.SC_OK, request.getRequestURI() ) );
@@ -181,7 +288,7 @@ Forwarded: no
}
}
-@@ -2054,7 +2053,7 @@
+@@ -2054,7 +2054,7 @@
{
}
@@ -190,7 +297,7 @@ Forwarded: no
throws IOException, ServletException
{
headers = new HashMap<String, String>();
-@@ -2102,10 +2101,9 @@
+@@ -2102,10 +2102,9 @@
cm.setPathSpec( "/*" );
TestSecurityHandler sh = new TestSecurityHandler();
@@ -204,7 +311,7 @@ Forwarded: no
sh.setConstraintMappings( new ConstraintMapping[]{ cm } );
return sh;
}
-@@ -2115,17 +2113,17 @@
+@@ -2115,17 +2114,17 @@
*/
@SuppressWarnings( "checkstyle:visibilitymodifier" )
public static class TestSecurityHandler
@@ -227,7 +334,7 @@ Forwarded: no
new HandlerRequestResponse( method, ( (Response) response ).getStatus(), request.getRequestURI() ) );
--- 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
-@@ -20,23 +20,23 @@
+@@ -20,23 +20,27 @@
*/
import org.apache.log4j.Logger;
@@ -250,15 +357,19 @@ Forwarded: no
-import org.mortbay.jetty.webapp.WebAppContext;
+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.Server;
+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.ServerConnector;
++import org.eclipse.jetty.server.SslConnectionFactory;
+import org.eclipse.jetty.util.security.Constraint;
++import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.eclipse.jetty.security.ConstraintMapping;
+import org.eclipse.jetty.security.HashLoginService;
+import org.eclipse.jetty.security.ConstraintSecurityHandler;
-+import org.eclipse.jetty.server.ssl.SslSocketConnector;
+import org.eclipse.jetty.server.session.AbstractSessionManager;
+import org.eclipse.jetty.servlet.FilterHolder;
+import org.eclipse.jetty.servlet.FilterMapping;
@@ -268,7 +379,7 @@ Forwarded: no
import javax.servlet.Filter;
import javax.servlet.Servlet;
-@@ -67,9 +67,9 @@
+@@ -67,9 +71,9 @@
private final WebAppContext webappContext;
@@ -280,7 +391,49 @@ Forwarded: no
private int filterCount = 0;
-@@ -114,11 +114,11 @@
+@@ -81,24 +85,34 @@
+ server = new Server();
+ if ( ssl )
+ {
+- SslSocketConnector connector = new SslSocketConnector();
+ String keystore = getResource( SERVER_SSL_KEYSTORE_RESOURCE_PATH ).getAbsolutePath();
+
+ Logger.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 );
+@@ -114,11 +128,11 @@
cm.setConstraint( constraint );
cm.setPathSpec( "/protected/*" );
@@ -295,7 +448,7 @@ Forwarded: no
securityHandler.setConstraintMappings( new ConstraintMapping[]{ cm } );
webappContext = new WebAppContext();
-@@ -127,7 +127,7 @@
+@@ -127,7 +141,7 @@
File base = getResource( SERVER_ROOT_RESOURCE_PATH );
logger.info( "docroot: " + base );
webappContext.setWar( base.getAbsolutePath() );
@@ -304,7 +457,7 @@ Forwarded: no
SessionHandler sessionHandler = webappContext.getSessionHandler();
( (AbstractSessionManager) sessionHandler.getSessionManager() ).setUsingCookies( false );
-@@ -159,8 +159,7 @@
+@@ -159,8 +173,7 @@
public void addUser( final String user, final String password )
{
@@ -314,6 +467,15 @@ Forwarded: no
}
public Server getServer()
+@@ -202,7 +215,7 @@
+ {
+ throw new IllegalStateException( "Server didn't start in: " + total + "ms." );
+ }
+- this.httpPort = server.getConnectors()[0].getLocalPort();
++ this.httpPort = ((org.eclipse.jetty.server.NetworkConnector) server.getConnectors()[0]).getLocalPort();
+ }
+
+ public int getHttpPort()
--- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
@@ -24,10 +24,10 @@
@@ -340,6 +502,15 @@ Forwarded: no
root.setResourceBase( new File( getBasedir(), "target" ).getAbsolutePath() );
ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
root.addServlet( servletHolder, "/*" );
+@@ -72,7 +72,7 @@
+ try
+ {
+ Wagon wagon = getWagon();
+- wagon.connect( new Repository( "id", "http://localhost:" + server.getConnectors()[0].getLocalPort() ) );
++ wagon.connect( new Repository( "id", "http://localhost:" + ((org.eclipse.jetty.server.NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
+
+ dest = File.createTempFile( "huge", "txt" );
+
@@ -103,7 +103,7 @@
server = new Server( 0 );
@@ -349,6 +520,15 @@ Forwarded: no
root.setResourceBase( new File( getBasedir(), "target" ).getAbsolutePath() );
ServletHolder servletHolder = new ServletHolder( new HttpServlet()
{
+@@ -130,7 +130,7 @@
+ try
+ {
+ Wagon wagon = getWagon();
+- wagon.connect( new Repository( "id", "http://localhost:" + server.getConnectors()[0].getLocalPort() ) );
++ wagon.connect( new Repository( "id", "http://localhost:" + ((org.eclipse.jetty.server.NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
+
+ dest = File.createTempFile( "huge", "txt" );
+
--- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonHttpServerTestCase.java
+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonHttpServerTestCase.java
@@ -21,9 +21,9 @@
@@ -388,7 +568,7 @@ Forwarded: no
protected Wagon getWagon()
--- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonPreemptiveTest.java
+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonPreemptiveTest.java
-@@ -20,9 +20,9 @@
+@@ -20,9 +20,14 @@
*/
import org.apache.maven.wagon.Wagon;
@@ -396,11 +576,46 @@ Forwarded: no
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.security.SslSocketConnector;
+import org.eclipse.jetty.server.Connector;
++import org.eclipse.jetty.server.HttpConnectionFactory;
++import org.eclipse.jetty.server.NetworkConnector;
++import org.eclipse.jetty.server.SecureRequestCustomizer;
+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.server.ssl.SslSocketConnector;
++import org.eclipse.jetty.server.ServerConnector;
++import org.eclipse.jetty.server.SslConnectionFactory;
++import org.eclipse.jetty.util.ssl.SslContextFactory;
public class HttpsWagonPreemptiveTest
extends HttpWagonTest
+@@ -37,13 +42,22 @@
+ System.setProperty( "javax.net.ssl.trustStore",
+ getTestFile( "src/test/resources/ssl/keystore" ).getAbsolutePath() );
+
+- SslSocketConnector connector = new SslSocketConnector();
+- connector.setPort( server.getConnectors()[0].getPort() );
+- connector.setKeystore( getTestPath( "src/test/resources/ssl/keystore" ) );
+- connector.setPassword( "wagonhttp" );
+- connector.setKeyPassword( "wagonhttp" );
+- connector.setTruststore( getTestPath( "src/test/resources/ssl/keystore" ) );
+- connector.setTrustPassword( "wagonhttp" );
++ SslContextFactory sslContextFactory = new SslContextFactory();
++ sslContextFactory.setKeyStorePath( getTestPath( "src/test/resources/ssl/keystore" ) );
++ sslContextFactory.setKeyStorePassword( "wagonhttp" );
++ sslContextFactory.setKeyManagerPassword( "wagonhttp" );
++ sslContextFactory.setTrustStorePath( getTestPath( "src/test/resources/ssl/keystore" ) );
++ sslContextFactory.setTrustStorePassword( "wagonhttp" );
++
++ org.eclipse.jetty.server.HttpConfiguration https_config = new org.eclipse.jetty.server.HttpConfiguration();
++ https_config.setSecureScheme( "https" );
++ https_config.addCustomizer( new SecureRequestCustomizer() );
++
++ ServerConnector connector = new ServerConnector(server,
++ new SslConnectionFactory( sslContextFactory, "http/1.1" ),
++ new HttpConnectionFactory( https_config ) );
++ connector.setPort( ((NetworkConnector) server.getConnectors()[0]).getPort() );
++
+ server.setConnectors( new Connector[]{ connector } );
+ }
+
--- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonTimeoutTest.java
+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonTimeoutTest.java
@@ -23,7 +23,7 @@
@@ -414,7 +629,7 @@ Forwarded: no
import java.util.Random;
--- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonTest.java
+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonTest.java
-@@ -19,9 +19,9 @@
+@@ -19,9 +19,15 @@
* under the License.
*/
@@ -422,11 +637,47 @@ Forwarded: no
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.security.SslSocketConnector;
+import org.eclipse.jetty.server.Connector;
++import org.eclipse.jetty.server.HttpConfiguration;
++import org.eclipse.jetty.server.HttpConnectionFactory;
++import org.eclipse.jetty.server.NetworkConnector;
++import org.eclipse.jetty.server.SecureRequestCustomizer;
+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.server.ssl.SslSocketConnector;
++import org.eclipse.jetty.server.ServerConnector;
++import org.eclipse.jetty.server.SslConnectionFactory;
++import org.eclipse.jetty.util.ssl.SslContextFactory;
public class HttpsWagonTest
extends HttpWagonTest
+@@ -41,13 +47,22 @@
+ System.setProperty( "javax.net.ssl.trustStore",
+ getTestFile( "src/test/resources/ssl/keystore" ).getAbsolutePath() );
+
+- SslSocketConnector connector = new SslSocketConnector();
+- connector.setPort( server.getConnectors()[0].getPort() );
+- connector.setKeystore( getTestPath( "src/test/resources/ssl/keystore" ) );
+- connector.setPassword( "wagonhttp" );
+- connector.setKeyPassword( "wagonhttp" );
+- connector.setTruststore( getTestPath( "src/test/resources/ssl/keystore" ) );
+- connector.setTrustPassword( "wagonhttp" );
++ SslContextFactory sslContextFactory = new SslContextFactory();
++ sslContextFactory.setKeyStorePath( getTestPath( "src/test/resources/ssl/keystore" ) );
++ sslContextFactory.setKeyStorePassword( "wagonhttp" );
++ sslContextFactory.setKeyManagerPassword( "wagonhttp" );
++ sslContextFactory.setTrustStorePath( getTestPath( "src/test/resources/ssl/keystore" ) );
++ sslContextFactory.setTrustStorePassword( "wagonhttp" );
++
++ HttpConfiguration https_config = new HttpConfiguration();
++ https_config.setSecureScheme( "https" );
++ https_config.addCustomizer( new SecureRequestCustomizer() );
++
++ ServerConnector connector = new ServerConnector(server,
++ new SslConnectionFactory( sslContextFactory, "http/1.1" ),
++ new HttpConnectionFactory( https_config ) );
++ connector.setPort( ((NetworkConnector) server.getConnectors()[0]).getPort() );
++
+ server.setConnectors( new Connector[]{ connector } );
+ }
+ }
--- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonReasonPhraseTest.java
+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonReasonPhraseTest.java
@@ -24,7 +24,7 @@
@@ -440,16 +691,53 @@ Forwarded: no
--- a/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/LightweightHttpsWagonTest.java
+++ b/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/LightweightHttpsWagonTest.java
-@@ -19,9 +19,9 @@
+@@ -19,10 +19,15 @@
* under the License.
*/
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.security.SslSocketConnector;
+-
+import org.eclipse.jetty.server.Connector;
++import org.eclipse.jetty.server.HttpConfiguration;
++import org.eclipse.jetty.server.HttpConnectionFactory;
++import org.eclipse.jetty.server.NetworkConnector;
++import org.eclipse.jetty.server.SecureRequestCustomizer;
+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.server.ssl.SslSocketConnector;
-
++import org.eclipse.jetty.server.ServerConnector;
++import org.eclipse.jetty.server.SslConnectionFactory;
++import org.eclipse.jetty.util.ssl.SslContextFactory;
public class LightweightHttpsWagonTest
extends LightweightHttpWagonTest
+ {
+@@ -36,13 +41,22 @@
+ System.setProperty( "javax.net.ssl.trustStore",
+ getTestFile( "src/test/resources/ssl/keystore" ).getAbsolutePath() );
+
+- SslSocketConnector connector = new SslSocketConnector();
+- connector.setPort( server.getConnectors()[0].getPort() );
+- connector.setKeystore( getTestPath( "src/test/resources/ssl/keystore" ) );
+- connector.setPassword( "wagonhttp" );
+- connector.setKeyPassword( "wagonhttp" );
+- connector.setTruststore( getTestPath( "src/test/resources/ssl/keystore" ) );
+- connector.setTrustPassword( "wagonhttp" );
++ SslContextFactory sslContextFactory = new SslContextFactory();
++ sslContextFactory.setKeyStorePath( getTestPath( "src/test/resources/ssl/keystore" ) );
++ sslContextFactory.setKeyStorePassword( "wagonhttp" );
++ sslContextFactory.setKeyManagerPassword( "wagonhttp" );
++ sslContextFactory.setTrustStorePath( getTestPath( "src/test/resources/ssl/keystore" ) );
++ sslContextFactory.setTrustStorePassword( "wagonhttp" );
++
++ HttpConfiguration https_config = new HttpConfiguration();
++ https_config.setSecureScheme( "https" );
++ https_config.addCustomizer( new SecureRequestCustomizer() );
++
++ ServerConnector connector = new ServerConnector(server,
++ new SslConnectionFactory( sslContextFactory, "http/1.1" ),
++ new HttpConnectionFactory( https_config ) );
++ connector.setPort( ((NetworkConnector) server.getConnectors()[0]).getPort() );
++
+ server.setConnectors( new Connector[] { connector } );
+ }
+
--
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