{"action":"created","issue":{"url":"https://api.github.com/repos/mp911de/lettuce/issues/246","repository_url":"https://api.github.com/repos/mp911de/lettuce","labels_url":"https://api.github.com/repos/mp911de/lettuce/issues/246/labels{/name}","comments_url":"https://api.github.com/repos/mp911de/lettuce/issues/246/comments","events_url":"https://api.github.com/repos/mp911de/lettuce/issues/246/events","html_url":"https://github.com/mp911de/lettuce/issues/246","id":157086408,"number":246,"title":"Lettuce seems to be incompatible with Azure Redis Cluster + SSL","user":{"login":"guperrot","id":623672,"avatar_url":"https://avatars.githubusercontent.com/u/623672?v=3","gravatar_id":"","url":"https://api.github.com/users/guperrot","html_url":"https://github.com/guperrot","followers_url":"https://api.github.com/users/guperrot/followers","following_url":"https://api.github.com/users/guperrot/following{/other_user}","gists_url":"https://api.github.com/users/guperrot/gists{/gist_id}","starred_url":"https://api.github.com/users/guperrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guperrot/subscriptions","organizations_url":"https://api.github.com/users/guperrot/orgs","repos_url":"https://api.github.com/users/guperrot/repos","events_url":"https://api.github.com/users/guperrot/events{/privacy}","received_events_url":"https://api.github.com/users/guperrot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mp911de/lettuce/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-26T21:45:52Z","updated_at":"2016-05-27T06:56:53Z","closed_at":null,"body":"Hi,\r\n\r\nI need to use Azure Redis Cluster, with password, with SSL, with pipelining support.\r\n\r\nI was using Jedis until now but it lacks support for cluster+ssl+password+pipelining combo.\r\n\r\nI tried lettuce v4.1.2.Final and currently hit a connection issue I am not able to solve on my own.\r\n\r\nConnecting to an Azure Redis Cluster (2 * P4) works without SSL but not with. Also I can connect to a single node with SSL but without cluster support. Problem is when combining cluster+ssl, the auth call times out (the command is sent over the wire but times out).\r\n\r\nThe cluster without SSL working code looks like this:\r\n\r\n```\r\nRedisURI redisURI = RedisURI.Builder.redis(host, 6379)\r\n  .withPassword(password)\r\n  .build();\r\nRedisClusterClient client = RedisClusterClient.create(redisURI);\r\nRedisAdvancedClusterCommands<String, String> connection = client.connect().sync();\r\nconnection.set(\"a\", \"1\");\r\nSystem.out.println(connection.get(\"a\"));\r\n```\r\n\r\nOutput is `1`\r\n\r\nEnabling SSL:\r\n\r\n```\r\nRedisURI redisURI = RedisURI.Builder.redis(host, 6380)\r\n  .withPassword(password)\r\n  .withSsl(true)\r\n  .build();\r\nRedisClusterClient client = RedisClusterClient.create(redisURI);\r\nRedisAdvancedClusterCommands<String, String> connection = client.connect().sync();\r\nconnection.set(\"a\", \"1\");\r\nSystem.out.println(connection.get(\"a\"));\r\n```\r\n\r\nIt hangs during 1 minute and log4j logs looks like this:\r\n\r\n```\r\n2016-05-26 14:25:17,110 | TRACE | lettuce-nioEventLoop-3-1 | CommandEncoder | [/{CLIENT} -> {HOST}/{IP}:6380] Sent: *2\r\n$4\r\nAUTH\r\n$44\r\n{PASSWORD}\r\n2016-05-26 14:26:17,134 | WARN  | main | ClusterTopologyRefresh | Cannot connect to RedisURI [host='***', port=6380]\r\ncom.lambdaworks.redis.RedisCommandTimeoutException: Command timed out\r\n    at com.lambdaworks.redis.LettuceFutures.await(LettuceFutures.java:95)\r\n    at com.lambdaworks.redis.LettuceFutures.awaitOrCancel(LettuceFutures.java:74)\r\n    at com.lambdaworks.redis.AbstractRedisAsyncCommands.auth(AbstractRedisAsyncCommands.java:64)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.connectToNode(RedisClusterClient.java:342)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.connectToNode(RedisClusterClient.java:301)\r\n    at com.lambdaworks.redis.cluster.ClusterTopologyRefresh.getConnections(ClusterTopologyRefresh.java:240)\r\n    at com.lambdaworks.redis.cluster.ClusterTopologyRefresh.loadViews(ClusterTopologyRefresh.java:132)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.loadPartitions(RedisClusterClient.java:468)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.initializePartitions(RedisClusterClient.java:445)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.connectClusterImpl(RedisClusterClient.java:359)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.connect(RedisClusterClient.java:244)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.connect(RedisClusterClient.java:231)\r\n    at com.ubikod.ermin.reach.tools.Test.main(Test.java:20)\r\nException in thread \"main\" com.lambdaworks.redis.RedisException: Cannot retrieve initial cluster partitions from initial URIs [RedisURI [host='***', port=6380]]\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.loadPartitions(RedisClusterClient.java:471)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.initializePartitions(RedisClusterClient.java:445)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.connectClusterImpl(RedisClusterClient.java:359)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.connect(RedisClusterClient.java:244)\r\n    at com.lambdaworks.redis.cluster.RedisClusterClient.connect(RedisClusterClient.java:231)\r\n    at com.ubikod.ermin.reach.tools.Test.main(Test.java:20)\r\n```\r\n\r\nKeeping SSL and disabling cluster works:\r\n\r\n```\r\nRedisURI redisURI = RedisURI.Builder.redis(host, 6380)\r\n  .withPassword(password)\r\n  .withSsl(true)\r\n  .build();\r\nRedisClient client = RedisClient.create(redisURI);\r\nRedisCommands<String, String> connection = client.connect().sync();\r\nconnection.set(\"a\", \"1\");\r\nSystem.out.println(connection.get(\"a\"));\r\n```\r\n\r\nSo that's not just an SSL issue, its a SSL + cluster combo issue. I tried to use `withStartTls`, disabling/enabling peer verification, raising the timeout, and any combination of those without luck.\r\n\r\nAny idea if it's a library bug or an Azure Redis bug?\r\nI can give you access to a test cluster if needed for verification."},"comment":{"url":"https://api.github.com/repos/mp911de/lettuce/issues/comments/222074092","html_url":"https://github.com/mp911de/lettuce/issues/246#issuecomment-222074092","issue_url":"https://api.github.com/repos/mp911de/lettuce/issues/246","id":222074092,"user":{"login":"guperrot","id":623672,"avatar_url":"https://avatars.githubusercontent.com/u/623672?v=3","gravatar_id":"","url":"https://api.github.com/users/guperrot","html_url":"https://github.com/guperrot","followers_url":"https://api.github.com/users/guperrot/followers","following_url":"https://api.github.com/users/guperrot/following{/other_user}","gists_url":"https://api.github.com/users/guperrot/gists{/gist_id}","starred_url":"https://api.github.com/users/guperrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guperrot/subscriptions","organizations_url":"https://api.github.com/users/guperrot/orgs","repos_url":"https://api.github.com/users/guperrot/repos","events_url":"https://api.github.com/users/guperrot/events{/privacy}","received_events_url":"https://api.github.com/users/guperrot/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T06:56:53Z","updated_at":"2016-05-27T06:56:53Z","body":"Hi, ok.\r\nFeel free to contact me if you need help accessing an Azure Redis cluster.\r\n"}}
{"actor":{"display_login":"guperrot"}}