purplefox/vert.x — pull request #256 by tomstrummer (2012-07-03 12:09:34+00:00)
Title: added SSL configurability

I needed to customize the SSL handling for the client and server (specifically to test out some TLS 1.2 functionality) but it could be used in general to control which SSL/TLS versions you want to use, which ciphers you want to use, client-side cert, etc. Use like this:

def server = vertx.createHttpServer( SSL: true,
keyStorePath: 'ecc.jks',
keyStorePassword: 'test123' )

server.sslConfigureInterceptor = { engine ->
engine.enabledProtocols = ['TLSv1.2']//,'TLSv1.1','TLSv1']//,'SSLv3']
/*	engine.enabledCipherSuites = [
'TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256',
'TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256',
'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256',
'TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256',
'TLS_RSA_WITH_AES_128_CBC_SHA256',
//	'TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA',
//	'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA',
//	'TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA',
//	'TLS_ECDH_RSA_WITH_AES_128_CBC_SHA',
//	'TLS_RSA_WITH_AES_128_CBC_SHA'
]
*/
println "Enabled only:"
println " $engine.enabledProtocols"
println " $engine.enabledCipherSuites"
} as SSLConfigureInterceptor