'Lo.
It seems that I'm receiving strange handshake failures when attempting
to send a message to a remote actor over TLS. The following program
shows the available ciphers on my system:
--8<--
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.SSLSocket
object ListCiphers {
def main(args : Array[String]) : Unit = {
val sf = SSLSocketFactory.getDefault()
val so = sf.createSocket().asInstanceOf[SSLSocket]
so.getEnabledCipherSuites().foreach(System.out.println)
}
}
--8<--
Which prints:
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_DSS_WITH_AES_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_DSS_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
TLS_ECDHE_RSA_WITH_RC4_128_SHA
SSL_RSA_WITH_RC4_128_SHA
TLS_ECDH_ECDSA_WITH_RC4_128_SHA
TLS_ECDH_RSA_WITH_RC4_128_SHA
TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
SSL_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
SSL_RSA_WITH_RC4_128_MD5
TLS_EMPTY_RENEGOTIATION_INFO_SCSV
I'm currently using TLS_RSA_WITH_AES_256_CBC_SHA but get the same error
with (apparently) any cipher.
The code is here:
https://github.com/io7m/akkatest-20130317/tree/ssl-test
The relevant output from the server when a client attempts to connect:
--8<--
[DEBUG] [03/17/2013 19:37:43.986] [New I/O server boss #1 ([id: 0x1c68a70f, /127.0.0.1:9000])] [NettyRemoteTransport(akka://
test-...@127.0.0.1:9000)] Using server SSL context to create SSLEngine ...
Using SSLEngineImpl.
Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
New I/O worker #5, READ: TLSv1 Handshake, length = 52
*** ClientHello, TLSv1
RandomCookie: GMT: 1363548807 bytes = { 16, 212, 35, 99, 147, 137, 244, 6, 84, 150, 202, 231, 67, 133, 76, 77, 114, 200, 34, 233, 93, 163, 141, 86, 143, 62, 246, 204 }
Session ID: {}
Cipher Suites: [TLS_RSA_WITH_AES_256_CBC_SHA]
Compression Methods: { 0 }
Extension renegotiation_info, renegotiated_connection: <empty>
***
%% Initialized: [Session-1, SSL_NULL_WITH_NULL_NULL]
New I/O worker #5, fatal error: 40: no cipher suites in common
javax.net.ssl.SSLHandshakeException: no cipher suites in common
%% Invalidated: [Session-1, SSL_NULL_WITH_NULL_NULL]
New I/O worker #5, SEND TLSv1 ALERT: fatal, description = handshake_failure
New I/O worker #5, WRITE: TLSv1 Alert, length = 2
New I/O worker #5, fatal: engine already closed. Rethrowing javax.net.ssl.SSLHandshakeException: no cipher suites in common
New I/O worker #5, called closeOutbound()
New I/O worker #5, closeOutboundInternal()
New I/O worker #5, called closeInbound()
New I/O worker #5, fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack?
[ERROR] [03/17/2013 19:37:44.138] [test-server-9] [NettyRemoteTransport(akka://
test-...@127.0.0.1:9000)] RemoteServerError@akka://
test-...@127.0.0.1:9000] Error[javax.net.ssl.SSLHandshakeException: no cipher suites in common]
New I/O worker #5, called closeOutbound()
New I/O worker #5, closeOutboundInternal()
--8<--
The full output from both the client and server are (including the
expanded configuration):
http://waste.io7m.com/2013/03/17/ssl-server-out.txt
http://waste.io7m.com/2013/03/17/ssl-client-out.txt
This is on Akka 2.1.2, on:
java version "1.7.0_17"
OpenJDK Runtime Environment (IcedTea7 2.3.8) (ArchLinux build 7.u17_2.3.8-1-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
M