SSL/TLS connection issue on FreeBSD 10.2
Posted: Fri Jan 08, 2016 8:58 pm
I have a FreeBSD 10.2p8 server running UnrealIRCD 3.2.5 compiled from ports with OpenSSL 1.0.1p-freebsd 9 Jul 2015 that seems to have trouble handling SSL connections from some clients.
From what I can tell, it gets hungup in the initial SSL handshake, specifically the server doesn't seem to respond to a ChangeCipherSpec request.
in doing some testing with openssl s_client this is what happens when it fails:
$ openssl version
OpenSSL 1.0.1j-freebsd 15 Oct 2014
$ openssl s_client -connect <hostname>:994 -msg
CONNECTED(00000004)
>>> TLS 1.2 Handshake [length 012e], ClientHello
<<< TLS 1.2 Handshake [length 003a], ServerHello
<<< TLS 1.2 Handshake [length 09d0], Certificate
<<< TLS 1.2 Handshake [length 002a], CertificateRequest
<<< TLS 1.2 Handshake [length 0004], ServerHelloDone
>>> TLS 1.2 Handshake [length 0007], Certificate
>>> TLS 1.2 Handshake [length 0106], ClientKeyExchange
>>> TLS 1.2 ChangeCipherSpec [length 0001]
>>> TLS 1.2 Handshake [length 0010], Finished
(hang until timeout)
34379245432:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/s23_lib.c:184:
From the same client, I get the result even if I try a different tls/ssl version. Of note is that if I try from an OS X client with a much older version of openssl, it seems to work (and also seems to use the SSL 2.0 handshake init:
$ openssl version
OpenSSL 0.9.8zg 14 July 2015
$ openssl s_client -connect <hostname>:6697 -msg
CONNECTED(00000003)
>>> SSL 2.0 [length 0080], CLIENT-HELLO
<<< TLS 1.0 Handshake [length 0031], ServerHello
<<< TLS 1.0 Handshake [length 09d0], Certificate
<<< TLS 1.0 Handshake [length 000a], CertificateRequest
<<< TLS 1.0 Handshake [length 0004], ServerHelloDone
>>> TLS 1.0 Handshake [length 0007], Certificate
>>> TLS 1.0 Handshake [length 0106], ClientKeyExchange
>>> TLS 1.0 ChangeCipherSpec [length 0001]
>>> TLS 1.0 Handshake [length 0010], Finished
<<< TLS 1.0 ChangeCipherSpec [length 0001]
<<< TLS 1.0 Handshake [length 0010], Finished
...
:<hostname> NOTICE AUTH :*** Looking up your hostname...
From what I can tell, it gets hungup in the initial SSL handshake, specifically the server doesn't seem to respond to a ChangeCipherSpec request.
in doing some testing with openssl s_client this is what happens when it fails:
$ openssl version
OpenSSL 1.0.1j-freebsd 15 Oct 2014
$ openssl s_client -connect <hostname>:994 -msg
CONNECTED(00000004)
>>> TLS 1.2 Handshake [length 012e], ClientHello
<<< TLS 1.2 Handshake [length 003a], ServerHello
<<< TLS 1.2 Handshake [length 09d0], Certificate
<<< TLS 1.2 Handshake [length 002a], CertificateRequest
<<< TLS 1.2 Handshake [length 0004], ServerHelloDone
>>> TLS 1.2 Handshake [length 0007], Certificate
>>> TLS 1.2 Handshake [length 0106], ClientKeyExchange
>>> TLS 1.2 ChangeCipherSpec [length 0001]
>>> TLS 1.2 Handshake [length 0010], Finished
(hang until timeout)
34379245432:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/s23_lib.c:184:
From the same client, I get the result even if I try a different tls/ssl version. Of note is that if I try from an OS X client with a much older version of openssl, it seems to work (and also seems to use the SSL 2.0 handshake init:
$ openssl version
OpenSSL 0.9.8zg 14 July 2015
$ openssl s_client -connect <hostname>:6697 -msg
CONNECTED(00000003)
>>> SSL 2.0 [length 0080], CLIENT-HELLO
<<< TLS 1.0 Handshake [length 0031], ServerHello
<<< TLS 1.0 Handshake [length 09d0], Certificate
<<< TLS 1.0 Handshake [length 000a], CertificateRequest
<<< TLS 1.0 Handshake [length 0004], ServerHelloDone
>>> TLS 1.0 Handshake [length 0007], Certificate
>>> TLS 1.0 Handshake [length 0106], ClientKeyExchange
>>> TLS 1.0 ChangeCipherSpec [length 0001]
>>> TLS 1.0 Handshake [length 0010], Finished
<<< TLS 1.0 ChangeCipherSpec [length 0001]
<<< TLS 1.0 Handshake [length 0010], Finished
...
:<hostname> NOTICE AUTH :*** Looking up your hostname...