title: NotSslRecordException: not an SSL/TLS record
body: <p>I'm using Redis Spring Data (<code>1.8.9.RELEASE</code>) with Lettuce (<code>4.5.0.Final</code>) as underlying Redis driver. It's using netty of version <code>4.1.29</code>.</p>
  
  <p>We're using Redis ElastiCache with Encryption-In-Transit and Encryption-At-rest enabled.</p>
  
  <p>I'm getting below error. I saw a post related to netty's <code>NotSslRecordException</code> in which <a href="https://github.com/spring-cloud/spring-cloud-gateway/issues/378" rel="noreferrer">suggested cause</a> is mismatch of http and https. But we tcp connection with elasticache.</p>
  
  <pre><code>Caused by: com.lambdaworks.redis.RedisException: com.lambdaworks.redis.RedisConnectionException: Unable to connect to xxx-redis-xxx-0002-002.-redis-xxx.usw2.cache.amazonaws.com:6379
      at com.lambdaworks.redis.LettuceFutures.await(LettuceFutures.java:130)
      at com.lambdaworks.redis.LettuceFutures.awaitOrCancel(LettuceFutures.java:96)
      at com.lambdaworks.redis.cluster.ClusterFutureSyncInvocationHandler.handleInvocation(ClusterFutureSyncInvocationHandler.java:117)
      at com.lambdaworks.redis.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
      at com.sun.proxy.$Proxy344.hgetall(Unknown Source)
      at org.springframework.data.redis.connection.lettuce.LettuceConnection.hGetAll(LettuceConnection.java:2887)
      ... 53 more
  Caused by: com.lambdaworks.redis.RedisConnectionException: Unable to connect to qbo-pprd-redis-rpg-0002-002.qbo-pprd-redis-rpg.jtrqdt.usw2.cache.amazonaws.com:6379
      at com.lambdaworks.redis.RedisConnectionException.create(RedisConnectionException.java:56)
      at com.lambdaworks.redis.cluster.PooledClusterConnectionProvider.lambda$getConnectionAsync$7(PooledClusterConnectionProvider.java:344)
      at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:822)
      at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:797)
      at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
      at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
      at com.lambdaworks.redis.AbstractRedisClient.lambda$null$0(AbstractRedisClient.java:331)
      at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
      at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
      at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
      at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
      at com.lambdaworks.redis.SslConnectionBuilder$SslChannelInitializer$2.userEventTriggered(SslConnectionBuilder.java:212)
      at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:329)
      at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:315)
      at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:307)
      at io.netty.handler.ssl.SslUtils.handleHandshakeFailure(SslUtils.java:319)
      at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1573)
      at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1542)
      at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1183)
      at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1243)
      at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
      at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
      at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
      at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
      at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442)
      at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      ... 1 more
  Caused by: java.util.concurrent.CompletionException: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 17000000242d455252206d6178206e756d626572206f6620636c69656e747320726561636865640d0a15000000020100
      at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
      at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
      at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:593)
      at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
      ... 38 more
  Caused by: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 17000000242d455252206d6178206e756d626572206f6620636c69656e747320726561636865640d0a15000000020100    
  </code></pre>