Posts

Showing posts from January, 2014

JEP 115: AES-GCM CipherSuites in JDK 8

Image
Chengdu, China RFC 5288 describes the use of AES in Galois Counter Mode ( GCM ) (AES-GCM) with various key exchange mechanisms as a cipher suite for TLS. AES-GCM is an authenticated encryption with associated data (AEAD) cipher (as defined in TLS 1.2 ) providing both confidentiality and data origin authentication. Java SE had already defined the AES-GCM interfaces in Java SE 7 .  In the coming Java SE 8, as an implementation of JEP 115 , AES-GCM algorithms is implemented in SunJCE provider, and AES-GCM cipher suites are implemented in SunJSSE provider. The following SSL/TLS AEAD/GCM cipher suites, in preference order, are enabled by default in SunJSSE provider for TLS version 1.2: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (RFC 5289) TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (RFC 5289) TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (RFC 5289) TLS_RSA_WITH_AES_256_GCM_SHA384 (RFC 5288) TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 (RFC 5289) TLS_ECDH_RSA_WITH_AES_...

JEP 114: TLS SNI Extension - Virtual Servers Dispatcher

Image
The implementation of  JEP 114  (TLS Server Name Indication (SNI) Extension) had  integrated into JDK 8  at October, 2012. In  the previous blog entries , we talked about the behavior changes in JSSE, and a few typical user cases . Let's look at a special user case, how to design a virtual server dispatcher in Java. Please refer to javax.net.ssl package of  JDK 8 APIs  for the detailed specification. Prepare the ClientHello Parser Applications need to implementation their own APIs to parser the client hello message from a plaintext socket. Suppose that an application design the following API to do the work, SSLCapabilities and SSLExplorer. SSLCapabilities is defined to show the SSL/TLS security capabilities during handshaking, SSLCapabilities can be retrieved by exploring the network data of an SSL/TLS connection via SSLExplorer.explore(ByteBuffer). /** * Encapsulates the security capabilities * of an SSL/TLS connection. * * Th...

JEP 114: TLS SNI Extension - Typical User Cases

Image
The implementation of  JEP 114  (TLS Server Name Indication (SNI) Extension) had  integrated into JDK 8  at October, 2012. In  the previous two blog entries , we talked about the behavior changes in JSSE. Let's look at a few typical user cases. Please refer to javax.net.ssl package of  JDK 8 APIs  for the detailed specification. Client side user cases Case C-1: I want to access "www.example.com" Set the host name explicit. SNIHostName serverName = new SNIHostName("www.example.com"); List<SNIServerName> serverNames = new ArrayList<>(1); serverNames.add(serverName); sslParameters.setServerNames(serverNames); It is recommend that the client always specify the host name. Case C-2: I don't want to use server name indication The server side terminates the transaction if server name indication is presented. I cannot use server name indication because of the compatibility issues in server side. Disable the ser...

JEP 114: TLS SNI Extension - SunJSSE Behavior Changes (Continue)

Image
Students Apartment, Harbin Institute of Technology (HIT), China The implementation of JEP 114 (TLS Server Name Indication (SNI) Extension) had integrated into JDK 8  at October, 2012. In the previous blog entry , we talked about the behavior changes in client and server mode. This blog entry will continue to talk about behavior changes in key manager and trust manager of JSSE. Please refer to javax.net.ssl package of  JDK 8 APIs for the detailed specification. Server Name Indication (SNI) sensitive KeyManager In JDK 7 and previous releases, the KeyManager of server is not server name indication sensitive. The KeyManager of SunJSSE provider does not check the server name indication in order to get the proper key and certificate. In JDK 8, the KeyManager of server of SunJSSE provider will try check the server name indication in extension and select the appropriate keys according to requested server name indication. For example, supposed that there are thre...

JEP 114: TLS SNI Extension - SunJSSE Behavior Changes

Image
Silver Cave, Guilin, China The implementation of JEP 114 (TLS Server Name Indication (SNI) Extension) had integrated into JDK 8  at October, 2012. This blog entry will talk about some useful behavior changes and user cases that make use of SNI extenstion.  Please refer to javax.net.ssl package of  JDK 8 APIs for the detailed specification. The SNI extension in client mode In JDK 7, if a SSL/TSL connection specified hostname of the server, and when the hostname is fully qualified domain name (FQDN), the hostname will be used as the default server name indication in ClientHello message, implicitly. For example:     SSLSocketFactory factory = ...     SSLSocket sslSocket = factory.createSocket("www.example.com", 443); the hostname, "www.example.com" will appear in the server name indication extension in ClientHello message. While for     SSLSocketFactory factory = ...     SSLSocket sslSocket = factory.createSocket...