This document explains how to enable Apache FTP Server to use Transport Layer Security (TLS) for encrypted client-server communication.
FtpServer uses the Java Secure Sockets Extension (JSSE) infrastructure to provide TLS/SSL sockets. JSSE comes packaged with several vendor Java distributions (i.e. Sun Java 1.4.x, IBM Java 1.3.x). For these distributions, please follow the vendor provided instructions for configuring the JVM to use JSSE services.
Security mode
Explicit Security (default)
In this mode server supports both secure and non-secure connection. Upon request from client (AUTH SSL) the server switches to the SSL/TLS mode.
In this case, the listener should not use implicit SSL (the default value):
config.listeners.default.implicit-ssl=false
Implicit Security
If you want to use implicit SSL connection, that is, SSL is always enabled on the control socket. The first thing you need to do is to tell the listener to use implicit SSL mode:
config.listeners.default.implicit-ssl=true
Data connection security
Implicit secure socket does not ensure encrypted data transfer. To use SSL/TLS in data connection, client has to send "PROT P" command. You also need to set the SSL configuration parameters as described below. Encrypted data transfer is supported for FTP passive (PASV) mode only.
Using the default SSL implementation
This describes how to use the default SSL implementation as shipped with FtpServer. Note that if needed, a custom implementation can be written by implementing the org.apache.ftpserver.ssl.Ssl
interface.
Control socket security
config.listeners.<listener name>.ssl.class |
Must be set to |
Key store configuration |
|
---|---|
config.listeners.<listener name>.ssl.keystore-file |
Key store file location. The default path is |
config.listeners.<listener name>.ssl.keystore-password |
Key store password. Required, no default value provided. |
config.listeners.<listener name>.ssl.keystore-type |
Key store type. The default value is |
config.listeners.<listener name>.ssl.keystore-algorithm |
Key store algorithm. The default value is |
config.listeners.<listener name>.ssl.key-password |
Key password. Required, no default value provided. |
Trust store configuration |
|
config.listeners.<listener name>.ssl.truststore-file |
Trust store file location. The default path is to use the key store, setting this value allows using a separate key store |
config.listeners.<listener name>.ssl.truststore-password |
Trust store password. No default value provided. Only used if truststore-file is set. |
config.listeners.<listener name>.ssl.truststore-type |
Trust store type. The default value is |
config.listeners.<listener name>.ssl.truststore-algorithm |
Trust store algorithm. The default value is |
TLS/SSL protocol configuration |
|
config.listeners.<listener name>.ssl.enabled-cipher-suites |
A comma seperated list of cipher suites to enable for this connection. The exact cipher suites that can be used depends on the Java version used, here are the names for Sun's JSSE provider. |
config.listeners.<listener name>.ssl.ssl-protocol |
SSL protocol. Supported values are |
config.listeners.<listener name>.ssl.client-authentication |
Client authentication. The default value is |
Data socket security
Data socket configuration supports the same options at the control socket, as described above. However, they are placed in the data-connection parent, for example:
config.listeners.<listener name>.data-connection.ssl.keystore-file