delano / redis-dump

Redis to JSON and nack again
https://rubygems.org/gems/redis-dump
MIT License
825 stars 124 forks source link

Support "rediss://..." URI #30

Closed hazi closed 4 years ago

hazi commented 5 years ago

Solve the error below

$ redis-dump -u "rediss://example.com" -D
#1565767946.1320: redis_uri: redis://rediss://example.com (0..15)
#1565767946.1366: Process: 1675; Memory: 23844
#1565767946.1367: CONNECT: redis://rediss://example.com/0
#1565767946.1369: CONNECT: redis://rediss://example.com/1
#1565767946.1370: CONNECT: redis://rediss://example.com/2
#1565767946.1371: CONNECT: redis://rediss://example.com/3
#1565767946.1371: CONNECT: redis://rediss://example.com/4
#1565767946.1372: CONNECT: redis://rediss://example.com/5
#1565767946.1372: CONNECT: redis://rediss://example.com/6
#1565767946.1374: CONNECT: redis://rediss://example.com/7
#1565767946.1375: CONNECT: redis://rediss://example.com/8
#1565767946.1375: CONNECT: redis://rediss://example.com/9
#1565767946.1376: CONNECT: redis://rediss://example.com/10
#1565767946.1376: CONNECT: redis://rediss://example.com/11
#1565767946.1377: CONNECT: redis://rediss://example.com/12
#1565767946.1378: CONNECT: redis://rediss://example.com/13
#1565767946.1378: CONNECT: redis://rediss://example.com/14
#1565767946.1379: CONNECT: redis://rediss://example.com/15
#1565767946.1379:  filter
Error connecting to Redis on rediss:6379 (SocketError)}
dejlek commented 4 years ago

I do not see where it switches to the TLS/SSL mode... (rediss is for encrypted communication). Also, the URL should be rediss://<user>:<token>@<hostname>:<port>/<db number> where user is entirely optional, but token is quite important. Same for the redis scheme.

hazi commented 4 years ago

~~Sorry, but it was an inappropriate explanation. I'm using a Google translate, so it might be poorly explained.~~

~~The argument URL is passed as it is to Redis::Dump. The URL is also used for Redis.new, and Redis works because it supports rediss://. This change removed the process of disabling rediss://.~~

The actual connection test is performed in this way.

$ bin/redis-dump -u "redis://:password@example.com:6379" -D
#1000000000.0000: redis_uri: redis://:password@example.com:6379 (0..15)
#1000000000.0000: Process: 21016; Memory: 20964
#1000000000.0000: CONNECT: redis://:password@example.com:6379/0
#1000000000.0000: CONNECT: redis://:password@example.com:6379/1
#1000000000.0000: CONNECT: redis://:password@example.com:6379/2
#1000000000.0000: CONNECT: redis://:password@example.com:6379/3
#1000000000.0000: CONNECT: redis://:password@example.com:6379/4
#1000000000.0000: CONNECT: redis://:password@example.com:6379/5
#1000000000.0000: CONNECT: redis://:password@example.com:6379/6
#1000000000.0000: CONNECT: redis://:password@example.com:6379/7
#1000000000.0000: CONNECT: redis://:password@example.com:6379/8
#1000000000.0000: CONNECT: redis://:password@example.com:6379/9
#1000000000.0000: CONNECT: redis://:password@example.com:6379/10
#1000000000.0000: CONNECT: redis://:password@example.com:6379/11
#1000000000.0000: CONNECT: redis://:password@example.com:6379/12
#1000000000.0000: CONNECT: redis://:password@example.com:6379/13
#1000000000.0000: CONNECT: redis://:password@example.com:6379/14
#1000000000.0000: CONNECT: redis://:password@example.com:6379/15
#1000000000.0000:  filter
Connection timed out

$ bin/redis-dump -u "rediss://:password@example.com:6379" -D
#1000000000.0000: redis_uri: rediss://:password@example.com:6379 (0..15)
#1000000000.0000: Process: 21042; Memory: 20548
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/0
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/1
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/2
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/3
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/4
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/5
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/6
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/7
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/8
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/9
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/10
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/11
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/12
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/13
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/14
#1000000000.0000: CONNECT: rediss://:password@example.com:6379/15
#1000000000.0000:  filter
#1000000000.0000: Memory after loading keys: 20000kb
#1000000000.0000:  dumping 947 (947) from redis://example.com:6379/0
^C
Exiting...
hazi commented 4 years ago

excuse me.

I was misunderstanding. This change was completely meaningless and originally corresponded to rediss://.