Hi Shawn,
On Tue, Sep 09, 2014 at 03:47:30PM -0600, Shawn Heisey wrote:
> I do not think this is a problem with haproxy (running 1.5.4), but I'm
> hoping haproxy can help me debug it.
>
> When I get SSL handshake failure, can haproxy be configured to log debug
> messages about WHY it failed?
Normally it will log one line indicating that a handshake has failed, with
a cause when it could determine it. The following SSL errors are diagnosed
and logged (from include/proto/connection.h) :
case CO_ER_SSL_EMPTY: return "Connection closed during SSL
handshake";
case CO_ER_SSL_ABORT: return "Connection error during SSL
handshake";
case CO_ER_SSL_TIMEOUT: return "Timeout during SSL handshake";
case CO_ER_SSL_TOO_MANY: return "Too many SSL connections";
case CO_ER_SSL_NO_MEM: return "Out of memory when initializing an
SSL connection";
case CO_ER_SSL_RENEG: return "Rejected a client-initiated SSL
renegociation attempt";
case CO_ER_SSL_CA_FAIL: return "SSL client CA chain cannot be
verified";
case CO_ER_SSL_CRT_FAIL: return "SSL client certificate not trusted";
case CO_ER_SSL_HANDSHAKE: return "SSL handshake failure";
case CO_ER_SSL_HANDSHAKE_HB: return "SSL handshake failure after
heartbeat";
case CO_ER_SSL_KILLED_HB: return "Stopped a TLSv1 heartbeat attack
(CVE-2014-0160)";
case CO_ER_SSL_NO_TARGET: return "Attempt to use SSL on an unknown
target (internal error)";
> We don't have any visibility into the
> client -- it's at a customer site in Japan, I'm in the US.
If you only get the "SSL handshake failure" message in the logs, it's very
likely that it was not possible to agree on a cipher. A sniffer in the middle
wlil help you diagnose it I guess.
> There is another question, but it's on an unrelated product. I've got
> the latest version of Wireshark (1.12.0), configured with my
> certificate's private key for SSL decrypting. The problem is that
> Wireshark is telling me that there is something wrong with the TLSv1
> frames ("Ignored Unknown Record"). I do not have decrypted responses,
> only decrypted requests, and I assume that is because of those TLSv1
> problems. The question: Is wireshark buggy, or are those TLSv1 frames
> actually problematic? The program was compiled against
> openssl-0.9.8e-27.el5_10.1 and it's running on a system with
> openssl-0.9.8e-7.el5 installed -- the production systems don't have a
> compiler or dev libraries installed, and when I attempted to install
> them, yum wouldn't work.
It is possible that the more recent openssl lib above defined a few extra
fields that are not supported by the older one used at runtime, resulting
in undefined behaviour. If you cannot upgrade the production version, I
suggest that instead you rebuild haproxy with a static openssl lib, ideally
with the same version first, then with a more recent one (eg: 1.0.1h) if it
continues to fail.
> If I force haproxy to use sslv3, then wireshark can decrypt the packets
> properly (when checked with a browser), but then our testing tools can't
> connect to it.
TLS supports a wide number of extensions, it is possible that wireshark
doesn't know them all. But it's also possible that some garbage is being
sent due to the incompatibility between the build and runtime version,
which would explain why Wireshark cannot decrypt it.
Regards,
Willy