ぎゃー
/app/vendor/bundle/ruby/3.3.0/gems/redis-4.8.1/lib/redis/connection/hiredis.rb:19:in `connect': SSL not supported by hiredis driver (NotImplementedError)
ぎゃー
{"level":"error","time":1724270873214,"pid":126,"hostname":"ddb70fbf-1599-44bf-b4ae-d2c1e83b8ce8","name":"streaming","err":{"type":"Error","message":"self-signed certificate in certificate chain","stack":"Error: self-signed certificate in certificate chain\n at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)\n at TLSSocket.emit (node:events:519:28)\n at TLSSocket._finishInit (node:_tls_wrap:1085:8)\n at ssl.onhandshakedone (node:_tls_wrap:871:12)","code":"SELF_SIGNED_CERT_IN_CHAIN"},"msg":"Redis Client Error!"}
プロダクションのデータストアを利用するMastodonをローカルで動かす
$ heroku config -s > env.zundan-mastodon
$ bundle install
$ yarn install
$ sed -i 's/^/export /' env.zundan-mastodon
$ source env.zundan-mastodon
$ bundle exec rake assets:precompile
Puma
$ BIND=0.0.0.0 bundle exec puma -C config/puma.rb &
$ curl -v -H "Host: $LOCAL_DOMAIN" -H "X-forwarded-proto: https" http://localhost:3000
Sidekiq
$ bundle exec sidekiq -c 1 -q default -q ingress -q mailers -q pull -q push
ストリーミング
$ BIND=0.0.0.0 node ./streaming
TLSのRedisへの接続情報をTLSではない環境変数に移す
$ for p in '' CACHE_ SIDEKIQ_; do echo export ${p}REDIS_URL=\$${p}REDIS_TLS_URL; echo unset ${p}REDIS_TLS_URL; done > env.remove_redis_tls_url
$ source env.remove_redis_tls_url
Puma
$ BIND=0.0.0.0 bundle exec puma -C config/puma.rb &
$ curl -H "Host: $LOCAL_DOMAIN" -H "X-forwarded-proto: https" http://localhost:3000
:
NotImplementedError (SSL not supported by hiredis driver):
:
Sidekiq
$ bundle exec sidekiq -c 1 -q default -q ingress -q mailers -q pull -q push
:
/home/zunda/c/src/github.com/zunda/mastodon/vendor/bundle/ruby/3.3.0/gems/redis-4.8.1/lib/redis/connection/hiredis.rb:19:in `connect': SSL not supported by hiredis driver (NotImplementedError)
:
ストリーミング
$ BIND=0.0.0.0 node ./streaming
:
:Error: self-signed certificate in certificate chain
at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
at TLSSocket.emit (node:events:519:28)
at TLSSocket._finishInit (node:_tls_wrap:1085:8)
at ssl.onhandshakedone (node:_tls_wrap:871:12)
:
とほほ
ストリーミングにオレオレ証明書を許してもらう
https://github.com/zunda/mastodon/commit/5b0d470412c98ba1ca337b1a431044ea100392a7
Ruby側はどうしようかねえ…
Ruby側はhiredisを除く感じにしてたわね (当時は非TLSでいいことになってリバートしたもよう)
https://github.com/zunda/mastodon/commit/f83555e34de34733eb0448c18277307c5d1fbd1a
export REDIS_DRIVER=ruby するだけでhiredisを使わなくできるようになってた!! オレオレ証明書については依然おこられる←
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 peeraddr=… state=error: certificate verify failed (self-signed certificate in certificate chain))
結局コード側でhiredisを使わないようにしました。あとオレオレ証明書を許してもらう。rubocopをだまらせるのにコメントを増やすの悔しいなあ…
https://github.com/zunda/mastodon/commit/a7484d6df49aab591a922627679993a8dd197203
@zundan ダジャレを検出しました(検出ワード: TLS)
@zundan ダジャレを検出しました(検出ワード: LOCAL)
@zundan ダジャレを検出しました(検出ワード: REDIS, LOCAL, TLS)
@zundan ダジャレを検出しました(検出ワード: REDIS)