title: "java.net.SocketException: Connection reset" when running a simpleSSL client
body: <p>I am attempting to create a client/server using the SSL communication. I followed the instructions listed here  (<a href="https://www.rabbitmq.com/ssl.html" rel="nofollow">https://www.rabbitmq.com/ssl.html</a>).</p>
  
  <p>I am greeted with this error:</p>
  
  <p>while running the server :</p>
  
  <pre><code>java.net.SocketException: Connection reset
      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
      at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
      at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
      at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
      at java.io.DataOutputStream.flush(DataOutputStream.java:123)
      at com.rabbitmq.client.impl.SocketFrameHandler.sendHeader(SocketFrameHandler.java:129)
      at com.rabbitmq.client.impl.SocketFrameHandler.sendHeader(SocketFrameHandler.java:134)
      at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:277)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:678)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:722)
  </code></pre>
  
  <p>while using the client :</p>
  
  <pre><code>Exception in thread "main" java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(Unknown Source)
      at java.net.SocketInputStream.read(Unknown Source)
      at sun.security.ssl.InputRecord.readFully(Unknown Source)
      at sun.security.ssl.InputRecord.read(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.waitForClose(Unknown Source)
      at sun.security.ssl.HandshakeOutStream.flush(Unknown Source)
      at sun.security.ssl.Handshaker.kickstart(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.kickstartHandshake(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
      at sun.security.ssl.AppOutputStream.write(Unknown Source)
      at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
      at java.io.BufferedOutputStream.flush(Unknown Source)
      at java.io.DataOutputStream.flush(Unknown Source)
      at com.rabbitmq.client.impl.SocketFrameHandler.sendHeader(SocketFrameHandler.java:129)
      at com.rabbitmq.client.impl.SocketFrameHandler.sendHeader(SocketFrameHandler.java:134)
      at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:277)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:678)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:722)
      at rmqClient.simpleSSL.main(simpleSSL.java:23)
  </code></pre>
  
  <p>here's my rabbit.config file :</p>
  
  <pre><code>[
      {ssl, [{versions, ['tlsv1.2', 'tlsv1.1']}]},
      {
      rabbit,
      [
            {ssl_listeners, [5675]},
        {ssl_options, [{cacertfile,"sslConn/ca_certificate.pem"},
                            {certfile,  "sslConn/server_certificate.pem"},
                            {keyfile,   "sslConn/server_key.pem"},
                            {versions, ['tlsv1.2', 'tlsv1.1']},
                            {ciphers,  [{ecdhe_ecdsa,aes_128_cbc,sha256},
                                        {ecdhe_ecdsa,aes_256_cbc,sha}]}
                           ]},     
            {tcp_listeners, [5672]},
            {loopback_users, []}
          ]
      }
  ].
  </code></pre>
  
  <p>here's also my client code :</p>
  
  <pre><code>    factory.setHost("10.3.9.139");
      factory.setPort(5673);
      factory.setUsername("User1");
      factory.setPassword("User1");
      factory.useSslProtocol();
      Connection conn = factory.newConnection();
      Channel channel = conn.createChannel();
      channel.queueDeclare("rabbitmq-java-test", false, true, true, null);
      channel.basicPublish("", "rabbitmq-java-test", null, "Hello, World".getBytes());
  </code></pre>