Question: Why do I see the following in my logs when
I start proftpd
using mod_tls
?
- mod_tls/2.2: compiled using OpenSSL version 'OpenSSL 0.9.7i 14 Oct 2005'
headers, but linked to OpenSSL version 'OpenSSL 0.9.7l 28 Sep 2006' library
What does this mean?
Answer: That is an informational/warning message.
Some systems are badly maintained by their admins (and/or by the packages
installed on the systems), such that the OpenSSL headers can become quite badly
out of sync with the OpenSSL libraries. If this discrepancy becomes bad
enough, you can see strange behavior from OpenSSL, ranging from random behavior
to segfaults. So mod_tls
tries to let the admin know about the
system's mismatched OpenSSL header/library versions.
Usually a minor OpenSSL version difference like the example above is OK,
but it really depends on exactly what changed in OpenSSL, and how.
If you see the above message, it is not a requirement that you recompile
proftpd
against the OpenSSL headers of the same version as the
OpenSSL libraries. However, the version discrepancy is a possible
source of trouble.
This header/library version check was added recently, hence why older
proftpd
releases do not log the warning.
Question: When should the TLSCertificateChainFile
directive be used?
Answer: Short answer: only in very specific
arrangements of CA hierarchies. Most of the time, you probably do not need
it.
The long explanation requires an illustration. Let's say we have a CA hierarchy
that looks something like this:
MyRootCA TheirRootCA
| |
MyServerCA TheirClientCA
| |
+------+------+ +------+------+
| | | | | |
certA certB certC cert1 cert2 cert3
Another way of asking the question thus is: "How to I send MyServerCA and
MyRootCA to the client without having them in my trusted CA locations"?
We might configure mod_tls
to have "certA" as the server's
certificate, via TLSRSACertificateFile
. The "certA" certificate
is issued by MyServerCA. And let's assume that we do not want to verify
any client certificates issued by MyServerCA.
We do want to be able to verify client certs issued by a different CA,
say, TheirClientCA. We configure TheirClientCA in mod_tls
using
TLSCACertificateFile
or TLSCACertificatePath
.
The client connects to mod_tls
, and starts the SSL/TLS handshake.
mod_tls
sends its "certA" certificate, along with any certs that
may be needed on the client for verifying the server's certificate. (This
is what appears in the "Certificate chain" output from s_client
;
see SSL/TLS debugging above.) Perhaps the client
does not have MyServerCA present in the client certificate store. So we need
to tell mod_tls
to send the MyServerCA and MyRootCA certs, along
with "certA". We could place the MyServerCA and MyRootCA certs in
TLSCACertificatePath
, but then any client certs issued by
MyServerCA would be trusted as well (and that's not what we want for this
example).
The solution here is to use TLSCertificateChainFile
to supply the
MyServerCA and MyRootCA certs, as part of the server cert chain. The
configured TLSCertificateChainFile
would contain the PEM-formatted
MyServerCA and MyRootCA public certs. And although the
TLSCertificateChainFile
states that the certs contained in the
file should be in certificate chain order, this is not strictly necessary; the
OpenSSL library will adjust the ordering as appropriate.
Question: I am having trouble connecting to my
SSL/TLS-enabled proftpd
; my FTPS client shows this error:
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
What is wrong?
Answer: It depends; the first thing is to check
your TLSLog
to see what errors, if any, are logged by the
mod_tls
module. For example, you might see:
Dec 14 10:47:58 mod_tls/2.4.1[13393]: unable to accept TLS connection: protocol error:
(1) error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher
The most common causes of these problems are: a) overly restrictive
TLSCipherSuite
configuration, or b) missing server
certificate (i.e. TLSRSACertificateFile
,
TLSDSACertificateFile
, or TLSPKCS12File
). The
file configured for the server certificate might also be badly formatted,
which would result in the same error.
Question: Is there a way to require TLS (FTPS) for
remote clients only, and allow simple FTP (without TLS) for local
clients (i.e. for clients in networks which we will be able to define
as "local")?
Answer: Yes.
To do this, you would use a combination of
<Class>
sections and
mod_ifsession's
<IfClass>
, e.g.:
<Class local>
From ...
</Class>
<IfModule mod_tls.c>
# Normal mod_tls configuration here
<IfClass local>
# Don't require FTPS from local clients
TLSRequired off
</IfClass>
<IfClass !local>
# Require FTPS from remote/non-local clients
TLSRequired on
</IfClass>
</IfModule>
Question: I have configured my proftpd
server for FTPS. When I use FileZilla to try to connect to it, though, I
see one of these errors in the FileZilla logs:
GnuTLS error -8: A record packet with illegal version was received
GnuTLS error -9: A TLS packet with unexpected length was received
Is there a ProFTPD directive to fix this error?
Answer: In most cases, the above client error indicates
an error unrelated to SSL/TLS on your server. Check the proftpd