LoginSignup
0
2

More than 5 years have passed since last update.

macOSのredis-cliからredis-serverにSSL接続する

Posted at

Azure Redis Cache を触っていて、redis-cliがSSLに対応されていないことを知りました。
で、ググっていたら、こんな情報を発見しました。
このmacOS版みたいな感じです。圧倒的感謝です。

Azure Redis Cacheにredis-cliで接続する (SSLで)
http://www.windows-maniax.com/kuniteru/azure1319.html

redis-cliのバージョン

$ redis-cli --version
redis-cli 4.0.2

stunnel.confの編集

自分の場合は新規作成。

$ vi /usr/local/etc/stunnel/stunnel.conf

内容はこんな感じ。Azureの例。

[redis-cli]
client = yes
accept = 127.0.0.1:6379
connect = ${your-redis-name}.redis.cache.windows.net:6380
# connect = example.redis.cache.windows.net:6380

起動

こんな感じでつながる。

$ redis-server
$ stunnel
$ redis-cli -h localhost
127.0.0.1:6379> auth this-is-primary-or-secondary's-access-key
OK
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2