You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2013/01/28 17:05:12 UTC

[1/4] git commit: Revert "rename field and remove not anymore used classes. some unit test failed but it is for Oleg testing"

Revert "rename field and remove not anymore used classes. some unit test failed but it is for Oleg testing"

This reverts commit d582cf92aabf1d5acaba8d618a8872c7e1b34d34.


Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/88e81a8b
Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/88e81a8b
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/88e81a8b

Branch: refs/heads/master
Commit: 88e81a8b48a6f31b878b0646cef4d344fe04405c
Parents: d582cf9
Author: olivier lamy <ol...@apache.org>
Authored: Mon Jan 28 16:53:13 2013 +0100
Committer: olivier lamy <ol...@apache.org>
Committed: Mon Jan 28 16:53:13 2013 +0100

----------------------------------------------------------------------
 .../shared/http4/AbstractHttpClientWagon.java      |    4 +-
 .../shared/http4/ConfigurableSSLSocketFactory.java |   93 +++++++++++++++
 wagon-providers/wagon-http/pom.xml                 |    1 -
 3 files changed, 95 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/88e81a8b/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http4/AbstractHttpClientWagon.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http4/AbstractHttpClientWagon.java b/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http4/AbstractHttpClientWagon.java
index e8d66e3..6246f89 100644
--- a/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http4/AbstractHttpClientWagon.java
+++ b/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http4/AbstractHttpClientWagon.java
@@ -259,7 +259,7 @@ public abstract class AbstractHttpClientWagon
      *
      * @since 2.0
      */
-    protected static boolean sslInsecure =
+    protected static boolean sslEasy =
         Boolean.valueOf( System.getProperty( "maven.wagon.http.ssl.insecure", "false" ) );
 
     /**
@@ -291,7 +291,7 @@ public abstract class AbstractHttpClientWagon
             SchemeRegistry schemeRegistry = new SchemeRegistry();
             schemeRegistry.register( new Scheme( "http", 80, PlainSocketFactory.getSocketFactory() ) );
             SSLSocketFactory sslSocketFactory;
-            if ( sslInsecure )
+            if ( sslEasy )
             {
                 try
                 {

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/88e81a8b/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http4/ConfigurableSSLSocketFactory.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http4/ConfigurableSSLSocketFactory.java b/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http4/ConfigurableSSLSocketFactory.java
new file mode 100644
index 0000000..dec0013
--- /dev/null
+++ b/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http4/ConfigurableSSLSocketFactory.java
@@ -0,0 +1,93 @@
+package org.apache.maven.wagon.shared.http4;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.http.conn.ConnectTimeoutException;
+import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.http.conn.ssl.X509HostnameVerifier;
+import org.apache.http.params.HttpParams;
+import org.codehaus.plexus.util.StringUtils;
+
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+/**
+ * @author Olivier Lamy
+ * @since 2.4
+ */
+@Deprecated
+public class ConfigurableSSLSocketFactory
+    extends SSLSocketFactory
+{
+    public ConfigurableSSLSocketFactory( SSLContext sslContext, X509HostnameVerifier hostnameVerifier )
+    {
+        super( sslContext, hostnameVerifier );
+    }
+
+    @Override
+    public Socket createSocket()
+        throws IOException
+    {
+        return enableSslProtocols( super.createSocket() );
+    }
+
+    @Override
+    public Socket createSocket( HttpParams params )
+        throws IOException
+    {
+        return enableSslProtocols( super.createSocket( params ) );
+    }
+
+    @Override
+    public Socket createSocket( Socket socket, String host, int port, boolean autoClose )
+        throws IOException, UnknownHostException
+    {
+        return enableSslProtocols( super.createSocket( socket, host, port, autoClose ) );
+    }
+
+    @Override
+    public Socket connectSocket( Socket socket, String host, int port, InetAddress localAddress, int localPort,
+                                 HttpParams params )
+        throws IOException, UnknownHostException, ConnectTimeoutException
+    {
+        return enableSslProtocols( super.connectSocket( socket, host, port, localAddress, localPort, params ) );
+    }
+
+    protected Socket enableSslProtocols( Socket socket )
+    {
+        String httpsProtocols = System.getProperty( "https.protocols" );
+        if ( StringUtils.isNotEmpty( httpsProtocols ) )
+        {
+            String[] protocols = StringUtils.split( httpsProtocols, "," );
+            if ( socket instanceof SSLSocket )
+            {
+                ( (SSLSocket) socket ).setEnabledProtocols( protocols );
+            }
+        }
+
+        return socket;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/88e81a8b/wagon-providers/wagon-http/pom.xml
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-http/pom.xml b/wagon-providers/wagon-http/pom.xml
index bc3ae84..78cf212 100644
--- a/wagon-providers/wagon-http/pom.xml
+++ b/wagon-providers/wagon-http/pom.xml
@@ -109,7 +109,6 @@ under the License.
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <systemPropertyVariables>
-            <maven.wagon.http.ssl.allowall>true</maven.wagon.http.ssl.allowall>
             <maven.wagon.http.ssl.insecure>true</maven.wagon.http.ssl.insecure>
             <maven.wagon.http.ssl.ignore.validity.dates>true</maven.wagon.http.ssl.ignore.validity.dates>
           </systemPropertyVariables>