title: Java 7 SSL changes with Java 6
body: <p>I have some SSL code that works perfectly fine with 1.6 but fails with 1.7 and 1.8.
  Using -Djavax.net.debug=all I have checked the difference between the logs, and a few things strike me (comparing 1.6.0_43 with 1.7.0_60)</p>
  
  <p>First difference is that Java 7/8 shows:</p>
  
  <pre><code>Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
  Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA
  </code></pre>
  
  <p>etc.</p>
  
  <p>whereas Java 6 does not have this.</p>
  
  <p>The cipher suites for Java 6 are:</p>
  
  <pre><code>Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_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_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
  </code></pre>
  
  <p>and for 1.7:</p>
  
  <pre><code>Cipher Suites: [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]
  </code></pre>
  
  <p>There are some common suites between the two.</p>
  
  <p>Also, I can see the length in protocols during handshakes...</p>
  
  <p>Java 6 ends up with</p>
  
  <p>--> SSLSession: Peer Host: MYIP:443, Cipher Suite: SSL_RSA_WITH_RC4_128_MD5, Protocol: TLSv1, Id: ....</p>
  
  <p>But Java 7:</p>
  
  <pre><code>main, handling exception: java.lang.UnsupportedOperationException
  %% Invalidated:  [Session-1, SSL_RSA_WITH_RC4_128_MD5]
  main, SEND TLSv1 ALERT:  fatal, description = internal_error
  main, WRITE: TLSv1 Alert, length = 2
  [Raw write]: length = 7
  0000: 15 03 01 00 02 02 50                               ......P
  main, called closeSocket()
  main, IOException in getSession():  javax.net.ssl.SSLException: java.lang.UnsupportedOperationException
  --&gt; debugSession(..)null
  </code></pre>
  
  <p>So.. according to this link <a href="https://www.playframework.com/documentation/2.3.x/CipherSuites" rel="nofollow">https://www.playframework.com/documentation/2.3.x/CipherSuites</a></p>
  
  <p>The cipher suites have changed a lot during 6, 7, 8</p>
  
  <p>Question A: It seems to be a server cipher suites issues - not compliant with Java 7/8, would you agree? Which means that the only solution to solve this Java 7/8 SSL cipher suite issue is to add all Java 6 Cipher Suites (Ok - I know they are weak - to the java.security cert file)</p>
  
  <p>Question B: Has anyone faced a similar issue, and how did you fix it?</p>
  
  <p>Thanks</p>