Search code examples
sslredistls1.2

redis fails to get CONFIG when using redis-benchmark


I have redis 7 server setup to provide only secure TLS connection and verified it is working properly using redis-cli. But when I do redis-benchmark, I get this error:

ERROR: failed to fetch CONFIG from 127.0.0.1:6379
WARNING: Could not fetch server CONFIG

How can I fix this error?


Solution

  • This command is working OK for me over an only TLS Redis Server.

    ./src/redis-benchmark --tls --cert ./tests/tls/redis.crt --key ./tests/tls/redis.key --cacert ./tests/tls/ca.crt
    
    ====== PING_INLINE ======
      100000 requests completed in 1.76 seconds
      50 parallel clients
    ...
    

    Redis server has been started using

    ./src/redis-server --tls-port 6379 --port 0 --tls-cert-file ./tests/tls/redis.crt --tls-key-file ./tests/tls/redis.key --tls-ca-cert-file ./tests/tls/ca.crt 
    

    Keys and certs have been generated using Redis TLS documentation

    You can check all redis-benchmark tls related options

    ./src/redis-benchmark --help
    Usage: redis-benchmark [OPTIONS] [COMMAND ARGS...]
    
    Options:
     --tls              Establish a secure TLS connection.
     --cacert <file>    CA Certificate file to verify with.
     --cacertdir <dir>  Directory where trusted CA certificates are stored.
                        If neither cacert nor cacertdir are specified, the default
                        system-wide trusted root certs configuration will apply.
     --insecure         Allow insecure TLS connection by skipping cert validation.
     --cert <file>      Client certificate to authenticate with.
     --key <file>       Private key file to authenticate with.
     --tls-ciphers <list> Sets the list of preferred ciphers (TLSv1.2 and below)
                        in order of preference from highest to lowest separated by colon (":").
                        See the ciphers(1ssl) manpage for more information about the syntax of this string.
     --tls-ciphersuites <list> Sets the list of preferred ciphersuites (TLSv1.3)
                        in order of preference from highest to lowest separated by colon (":").
                        See the ciphers(1ssl) manpage for more information about the syntax of this string,
                        and specifically for TLSv1.3 ciphersuites.
    

    non-tls related options have been omitted.