title: Java 7: SEND TLSv1.2 ALERT: fatal, description = handshake_failure mule
body: <p>I'm using <strong>java 7</strong>, <strong>mule 3.7.0</strong>, I've installed <strong>Java Cryptography Extension</strong></p>
  
  <p>I'm trying to send a request to a server, but I'm getting:</p>
  
  <pre><code>java.io.EOFException: SSL peer shut down incorrectly
          at sun.security.ssl.InputRecord.read(InputRecord.java:482)
          at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:944)
          at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1342)
  
  
  Cipher Suites: [TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA]
  Compression Methods:  { 0 }
  Extension elliptic_curves, curve names: {secp256r1, secp384r1, secp521r1}
  Extension ec_point_formats, formats: [uncompressed]
  Extension extended_master_secret
  Extension server_name, server_name: [host_name: merchant.payb.lv]
  ***
  entry.worker.04, WRITE: TLSv1 Handshake, length = 136
  entry.worker.04, received EOFException: error
  entry.worker.04, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
  entry.worker.04, SEND TLSv1.2 ALERT:  fatal, description = handshake_failure
  entry.worker.04, WRITE: TLSv1.2 Alert, length = 2
  entry.worker.04, Exception sending alert: java.net.SocketException: Broken pipe (Write failed)
  entry.worker.04, called closeSocket()
  entry.worker.04, called close()
  entry.worker.04, called closeInternal(true)
  entry.worker.04, called close()
  entry.worker.04, called closeInternal(true)
  entry.worker.04, called close()
  entry.worker.04, called closeInternal(true)
  </code></pre>
  
  <p>As I understood the problem is that there's no support for <strong>TLSv1.2</strong>, but there should be after I installed <strong>Java Cryptography Extension</strong>, can anyone help, please?</p>
  
  <p>I've tried:</p>
  
  <pre><code>System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2")
  System.setProperty("jdk.tls.client.protocols", "TLSv1,TLSv1.1,TLSv1.2")
  System.setProperty("https.cipherSuites", "TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA")
  </code></pre>
  
  <p>Also tried:</p>
  
  <pre><code>String[] ciphers = new String[2]
  ciphers[0] = "TLS_RSA_WITH_AES_256_CBC_SHA256"
  ciphers[1] = "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA"
  SSLSocket.setEnabledCipherSuites(ciphers)
  
  String[] protocols = new String[1]
  protocols[0] = "TLSv1.2";
  SSLSocket.setEnabledProtocols(protocols)
  </code></pre>