You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/01/05 22:53:18 UTC

svn commit: r1227858 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTPSClient.java

Author: sebb
Date: Thu Jan  5 21:53:17 2012
New Revision: 1227858

URL: http://svn.apache.org/viewvc?rev=1227858&view=rev
Log:
NET-426 FTPS: Hook to customize _openDataConnection_ SSLSocket before startHandshake() is called

Modified:
    commons/proper/net/trunk/src/changes/changes.xml
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1227858&r1=1227857&r2=1227858&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml (original)
+++ commons/proper/net/trunk/src/changes/changes.xml Thu Jan  5 21:53:17 2012
@@ -59,29 +59,32 @@ The <action> type attribute can be add,u
         <release version="3.1-SNAPSHOT" date="TBA" description="
 TBA
         ">
-            <action issue="NET-430" dev="sebb" type="fix">
+            <action issue="NET-426" dev="sebb" type="add" due-to="Ketan">
+            FTPS: Hook to customize _openDataConnection_ SSLSocket before startHandshake() is called
+            </action>
+            <action issue="NET-430" dev="sebb" type="fix" due-to="Thomas Mathis">
             Can't login to POP3S Server using explicit mode
             </action>
-            <action issue="NET-434" dev="sebb" type="fix">
+            <action issue="NET-434" dev="sebb" type="fix" due-to="zhangyong">
             FTPClient fails to close local listener socket when command socket channel encounter "ReadTimeoutException"
             </action>
-            <action issue="NET-436" dev="sebb" type="add">
+            <action issue="NET-436" dev="sebb" type="add" due-to="Jürgen Jung">
             Support for SYST "Mac OS" listing - "MACOS Peter's Server"
             </action>
-            <action issue="NET-425" dev="sebb" type="add">
+            <action issue="NET-425" dev="sebb" type="add" due-to="Steven Jardine">
             _openDataConnection_, __storeFile, and __storeFileStream should be protected and take String for FTP command.
             Likewise for receiveFile and receiveFileStream.
             </action>
-            <action issue="NET-416" dev="sebb" type="update">
+            <action issue="NET-416" dev="sebb" type="update" due-to="Abhijeet Gaikwad">
             Increasing sub-negotiation message holder array size
             </action>
-            <action issue="NET-428" dev="sebb" type="fix">
+            <action issue="NET-428" dev="sebb" type="fix" due-to="sebb">
             SubnetUtils throws ArrayIndexOutOfBoundsException for new SubnetUtils( "1.2.3.4/32" ).getInfo().getAllAddresses()
             </action>
             <action issue="NET-421" dev="sebb" type="fix" due-to="Oliver Saggau">
             Problem connecting to TLS/SSL SMTP server using explicit mode.
             </action>
-            <action issue="NET-415" dev="sebb" type="fix">
+            <action issue="NET-415" dev="sebb" type="fix" due-to="george thomas">
             typo in migration how-to.
             </action>
         </release>

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java?rev=1227858&r1=1227857&r2=1227858&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java Thu Jan  5 21:53:17 2012
@@ -548,6 +548,7 @@ public class FTPSClient extends FTPClien
     protected Socket _openDataConnection_(int command, String arg)
             throws IOException {
         Socket socket = super._openDataConnection_(command, arg);
+        _prepareDataSocket_(socket);
         if (socket instanceof SSLSocket) {
             SSLSocket sslSocket = (SSLSocket)socket;
 
@@ -572,6 +573,18 @@ public class FTPSClient extends FTPClien
     }
 
     /**
+    * Performs any custom initialization for a newly created SSLSocket (before
+    * the SSL handshake happens).
+    * Called by {@link #_openDataConnection_(int, String)} immediately 
+    * after creating the socket.
+    * The default implementation is a no-op
+    * @throws IOException 
+    */
+    protected void _prepareDataSocket_(Socket socket)
+            throws IOException {
+    }
+
+    /**
      * Get the currently configured {@link TrustManager}.
      *
      * @return A TrustManager instance.