Skip to content
Permalink
Browse files
Bit more trace
  • Loading branch information
sebbASF committed Jul 27, 2021
1 parent 4aace8d commit 7de881f28a80d770f243bdb4feded60ee82f2aed
Showing 1 changed file with 5 additions and 6 deletions.
@@ -33,6 +33,7 @@
import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.lang3.JavaVersion;
import org.apache.commons.lang3.SystemUtils;
import org.apache.commons.net.PrintCommandListener;
import org.apache.ftpserver.FtpServer;
import org.apache.ftpserver.FtpServerFactory;
import org.apache.ftpserver.ftplet.FtpException;
@@ -41,7 +42,6 @@
import org.apache.ftpserver.ssl.SslConfigurationFactory;
import org.apache.ftpserver.usermanager.PropertiesUserManagerFactory;
import org.apache.ftpserver.usermanager.impl.BaseUser;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -65,12 +65,8 @@
@RunWith(Parameterized.class)
public class FTPSClientTest {

private static final String JDK_TLS_CLIENT_PROTOCOLS = "jdk.tls.client.protocols";

private static int SocketPort;

private static String ConnectionUri;

private static FtpServer EmbeddedFtpServer;

private static final String USER_PROPS_RES = "org/apache/commons/net/ftpsserver/users.properties";
@@ -159,7 +155,6 @@ private synchronized static void setUpClass(final boolean implicit) throws FtpEx
EmbeddedFtpServer = serverFactory.createServer();
EmbeddedFtpServer.start();
SocketPort = ((org.apache.ftpserver.impl.DefaultFtpServer) EmbeddedFtpServer).getListener("default").getPort();
ConnectionUri = "ftps://test:test@localhost:" + SocketPort;
// System.out.printf("jdk.tls.disabledAlgorithms = %s%n", System.getProperty("jdk.tls.disabledAlgorithms"));
trace("Server started");
}
@@ -183,6 +178,7 @@ private void assertClientCode(final FTPSClient client) {
private FTPSClient loginClient() throws SocketException, IOException {
trace(">>loginClient");
final FTPSClient client = new FTPSClient(IMPLICIT);
client.addProtocolCommandListener(new PrintCommandListener(System.err));
//
client.setControlKeepAliveReplyTimeout(null);
assertEquals(0, client.getControlKeepAliveReplyTimeoutDuration().getSeconds());
@@ -200,14 +196,17 @@ private FTPSClient loginClient() throws SocketException, IOException {
assertEquals(62, client.getDataTimeout().getSeconds());
//
client.setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>loginClient-connect");
client.connect("localhost", SocketPort);
//
assertClientCode(client);
assertEquals(SocketPort, client.getRemotePort());
//
trace(">>loginClient-login");
assertTrue(client.login("test", "test"));
assertClientCode(client);
//
trace(">>loginClient-binary");
client.setFileType(FTP.BINARY_FILE_TYPE);
assertClientCode(client);
//

0 comments on commit 7de881f

Please sign in to comment.