GithubHelp home page GithubHelp logo

apache / mina-ftpserver Goto Github PK

View Code? Open in Web Editor NEW
43.0 9.0 26.0 6.64 MB

Apache Mina FTP Server

License: Apache License 2.0

Java 98.55% HTML 0.62% Batchfile 0.60% Shell 0.22%
network-server java mina network-client

mina-ftpserver's Introduction

mina-ftpserver

The active branches are:

  • 1.1.x
  • 1.2.x

We do not use the branch master.

mina-ftpserver's People

Contributors

elecharny avatar garydgregory avatar hboutemy avatar jon-valliere avatar jvermillard avatar sebbasf avatar trustin avatar xenoamess avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mina-ftpserver's Issues

Request for the release package

Glad to see the progress on this project, and I do like to use it as my FTP server, as it's fast and stable, and easy to use.
May I ask for the release package on Github, as the current distribution folder doesn't contain the jar files, and user needs to build the project by themselves.
For example, download 1.1.1 at https://mina.apache.org/ftpserver-project/downloads.html will include all the jar files and can be used for an FTP server setup in a minute.

Thanks!

not a bug - clarify passive port range behavior

Edit: fixed test, there's no bug.

public class PassivePortsTest {

	@Test
	public void testSimple() {
		assertPassivePorts("8182-8190", IntStream.range(8182, 8190+1));
	}
	@Test
	public void testComplex() {
		assertPassivePorts("8182-8190;8192-8200",
				IntStream.concat(IntStream.range(8182, 8191), IntStream.range(8192, 8201)));
	}

	private void assertPassivePorts(String rangeString, IntStream range) {
		var passivePorts = new PassivePorts(rangeString, false);
		var expected = new TreeSet<>(range.boxed().collect(Collectors.toSet()));
		try {
			var freeSet = new TreeSet<>((List<Integer>) FieldUtils.readField(passivePorts, "freeList", true));
			var values = new TreeSet<>();
			for (int i = 0; i < expected.size(); i++) {
				values.add(passivePorts.reserveNextPort());
			}
			// API-level check
			assertEquals(expected, values);
			// Reflection check
			assertEquals(expected, freeSet);
		} catch (IllegalAccessException e) {
			throw new RuntimeException(e);
		}
	}

}

Concurrent active mode FTP transfers fail when setting a static "data port"

When configuring the "local-port" element within the /res/conf/ftpd-*.xml file to a static value, then the ability to run parallel active FTP transfers is lost, and results in an immediate "425" error for the other concurrent transfer attempts.
RE: https://mina.apache.org/ftpserver-project/configuration_listeners.html#active-element,

When "local-port" is not configured, then the active mode data-port connections default to sourcing from "any available port" on the ftp server. For example, by default, a Windows 2016 server may choose a dynamic source data-port of 61753 for one transfer when connecting back to the client at the location already specified by the client's PORT command, and a different data-port like 61234 for another parallel transfer.
Screenshot of test configuration:
apache-ftpserver 1 1 1 configuration using static source port

When using another FTP server such as vsftpd, we can run parallel active transfers, all sourcing from a FTP server data-port of 20.
In that case, we would configure the option "connect_from_port_20=YES" in vsftpd's config file (RE: http://vsftpd.beasts.org/vsftpd_conf.html), so the FTP server isn't choosing dynamic source ports when connecting back to the client PORT location.

I've tested this behavior with apache ftpserver v1.1.1, 1.1.4, and 1.2, and the behavior seems consistent among all of them.

In this screenshot, my "ftp-dev-01" server has an IP of 172.16.248.202.
When running a "10x parallel download" jmeter test, and running wireshark to inspect the responses, I see that the server only sends one SYN attempt from port 20 back to my client. I expect to see 10x SYN attempts. The one transfer succeeds, however the other 9 immediately return a "425" error:
JMeter of 10x parallel active FTP DL's and wireshark showing only 1 SYN to client PORT

Attaching my jmeter 5.6.3 test, which uses 10 parallel threads to download a test.txt file from the server.
ftp server concurrent download JMETER test.jmx.txt

If I switch the JMETER thread/iteration configuration to use 1 thread and 10 iterations (i.e. performing it serially), then all the downloads complete successfully, and all source from server port 20.

Log remaining passive ports

It would be exceptionally useful to track the number of remaining passive ports available in the pool as they are assigned/released. Before I work on PR, I wanted to check if there was any was of observing this? I can't see a mechanism for this at present.
Many thanks

Apache FTPServer adapt to Apache MINA 2.2.x

Hi, I see that Apache MINA 2.2.x rewrites the SSL/TLS layer to address some flaws that were hard to fix in 2.1.x.
Apache FTPServer depends on Apache MINA, but the latest released version of Apache FTPServer (1.2.0) still depends on Apache MINA 2.1.6.
So, I'd like to ask if there are plans to release a new version of Apache FTPServer to adapt to Apache MINA 2.2.x.

image

TLS protocol is not enabled correctly, also only one can be set

In the IODataConnectionFactory class, the method createDataSocket is using this code:

if (ssl.getEnabledProtocol() != null) { ssoc.setEnabledProtocols(new String[] { ssl.getEnabledProtocol() }); }

So clearly, when we have multiple protocols (TLSv1.2, TLSv1.3) this will not work.

We also have to change the sslProtocol to this:
sslConfigurationFactory.setSslProtocol("TLSv1.2");

Because it seems that the default is "TLS", which is not a valid option in the ProtocolVersion class from jdk 11
enum ProtocolVersion { TLS13(772, "TLSv1.3", false), TLS12(771, "TLSv1.2", false), TLS11(770, "TLSv1.1", false), TLS10(769, "TLSv1", false), SSL30(768, "SSLv3", false), SSL20Hello(2, "SSLv2Hello", false), DTLS12(65277, "DTLSv1.2", true), DTLS10(65279, "DTLSv1.0", true), NONE(-1, "NONE", false);

Shall we remove or upgrade the log4j 1.2.17.jar

I built the 1.1.2, the good news is that the log4j api is 2.17, however, the log4j 1.2.17.jar is still there, is that required? I would suggest upgrading it:
image

I also tested by remove it directly, it doesn't work.

DataConnectionConfigurationFactory cannot be used if passiveAddress and passiveExternalAddress are not set

in v1.2.0:

DataConnectionConfigurationFactory:

    private void checkValidAddresses(){
        try{
            InetAddress.getByName(passiveAddress);
            InetAddress.getByName(passiveExternalAddress);
        }catch(UnknownHostException ex){
            throw new FtpServerConfigurationException("Unknown host", ex);
        }
    }

if passiveAddress or passiveExternalAddress are null (unconfigured), the createDataConnectionConfiguration() fails to create a DataConnectionConfiguration:

    public DataConnectionConfiguration createDataConnectionConfiguration() {
        checkValidAddresses();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.