summaryrefslogtreecommitdiff
path: root/src/redis-benchmark.c
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2021-02-07 12:36:56 +0200
committerGitHub <noreply@github.com>2021-02-07 12:36:56 +0200
commitbe83bb13a8eaad68b7580b95c696f2554cf7100e (patch)
treea0c89c828c30578b9d88b155eb931e1281ad6a10 /src/redis-benchmark.c
parentaea6e71ef82701e07177744e600e1ef20d60b7d0 (diff)
downloadredis-be83bb13a8eaad68b7580b95c696f2554cf7100e.tar.gz
Add --insecure option to command line tools. (#8416)
Disable certificate validation, making it possible to connect to servers without configuring full trust chain. The use of this option is insecure and makes the connection vulnerable to man in the middle attacks.
Diffstat (limited to 'src/redis-benchmark.c')
-rw-r--r--src/redis-benchmark.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c
index a955c0d4c..164f5e3ee 100644
--- a/src/redis-benchmark.c
+++ b/src/redis-benchmark.c
@@ -1516,6 +1516,8 @@ int parseOptions(int argc, const char **argv) {
} else if (!strcmp(argv[i],"--cacert")) {
if (lastarg) goto invalid;
config.sslconfig.cacert = strdup(argv[++i]);
+ } else if (!strcmp(argv[i],"--insecure")) {
+ config.sslconfig.skip_cert_verify = 1;
} else if (!strcmp(argv[i],"--cert")) {
if (lastarg) goto invalid;
config.sslconfig.cert = strdup(argv[++i]);
@@ -1585,6 +1587,7 @@ usage:
" --cacertdir <dir> Directory where trusted CA certificates are stored.\n"
" If neither cacert nor cacertdir are specified, the default\n"
" system-wide trusted root certs configuration will apply.\n"
+" --insecure Allow insecure TLS connection by skipping cert validation.\n"
" --cert <file> Client certificate to authenticate with.\n"
" --key <file> Private key file to authenticate with.\n"
" --tls-ciphers <list> Sets the list of prefered ciphers (TLSv1.2 and below)\n"
@@ -1682,6 +1685,7 @@ int main(int argc, const char **argv) {
signal(SIGHUP, SIG_IGN);
signal(SIGPIPE, SIG_IGN);
+ memset(&config.sslconfig, 0, sizeof(config.sslconfig));
config.numclients = 50;
config.requests = 100000;
config.liveclients = 0;