Issue
I'm getting temporary or permanent SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello
errors when trying to connect to Heroku Key-Value Store.
Resolution
OpenSSL::SSL::SSLError (_SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello_)
is the error that some Redis Ruby clients raise when Redis 6 rejects a connection because the maximum number of clients to Redis has been reached.
In previous Redis versions without native TLS support, Redis would return a ERR max number of clients reached
error instead. Starting with Redis 6, which provides native TLS support, Redis will directly drop the connection if the number of maxclients
is reached. At this point of the connection, the TLS handshake of the connection hasn't happened yet, which results in seeing a SSL connection error instead of a more descriptive error message.
In other cases like the case for the redis-py
Python client, this behavior results in errors similar to ConnectionError: Error 8 connecting to xxx. EOF occurred in violation of protocol (_ssl.c:1123)
.