title: Getting RabbitMQ connection issues when connecting with SSL
body: <p>I get the following exception while connecting to a server on port 8071. I was told SSL is configured on port 8071 due to which the connection is blocked but the error message does not explicitly tell anything about SSL handshake failing etc. </p>
  
  <pre><code>Attempting to connect to: auslabrmq1.abc.xyz.com:8071
  16:41:07.012 [springListenerContainerCSWF-5] ERROR org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Failed to check/redeclare auto-delete queue(s).
  org.springframework.amqp.AmqpIOException: java.io.IOException
      at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:71)
      at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:509)
      at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:702)
      at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:214)
      at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:2073)
      at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2047)
      at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2027)
      at org.springframework.amqp.rabbit.core.RabbitAdmin.getQueueProperties(RabbitAdmin.java:403)
      at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.attemptDeclarations(AbstractMessageListenerContainer.java:1787)
      at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.redeclareElementsIfNecessary(AbstractMessageListenerContainer.java:1768)
      at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.initialize(SimpleMessageListenerContainer.java:1195)
      at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1041)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: java.io.IOException: null
      at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:126)
      at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:122)
      at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:373)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1104)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1054)
      at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1218)
      at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:471)
      ... 11 common frames omitted
  Caused by: com.rabbitmq.client.ShutdownSignalException: connection error
      at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
      at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
      at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:494)
      at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:315)
      ... 15 common frames omitted
  Caused by: java.io.EOFException: null
      at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
      at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91)
      at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:164)
      at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:596) 
  </code></pre>
  
  <p>Can anybody help me understand why exactly this may be happening? </p>
  
  <p>XML bean configuration that I am using is:</p>
  
  <pre><code>&lt;bean id="clientConnectionFactorySSL"
          class="org.springframework.amqp.rabbit.connection.RabbitConnectionFactoryBean"&gt;
          &lt;property name="useSSL" value="true" /&gt;
          &lt;property name="sslAlgorithm" value="TLSv1.2"/&gt;
          &lt;property name="keyStoreType" value="PKCS12"/&gt;
          &lt;property name="trustStoreType" value="JKS"/&gt;
          &lt;property name="skipServerCertificateValidation" value="false"/&gt;
          &lt;/bean&gt;
  
  
      &lt;!-- CachingConnectionFactory --&gt;
      &lt;bean id="cachingConnectionFactory"
          class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory"&gt;
          &lt;constructor-arg value = "clientConnectionFactorySSL"/&gt;
          &lt;property name="virtualHost" value="XXXX" /&gt;
          &lt;property name="host" value="XXX-XXX" /&gt;
          &lt;property name="port" value="8071" /&gt;
          &lt;property name="username" value="username"/&gt;
          &lt;property name="password" value="password"/&gt;
          &lt;/bean&gt;
  </code></pre>