summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2020-02-06 11:22:20 +0100
committerGitHub <noreply@github.com>2020-02-06 11:22:20 +0100
commit1012514e0f10aa090eb39c870b82b10724d4d667 (patch)
tree7ddab6b4c6df197b3afacc00be4375b81a525130
parent5bfba06a3bddc7041987652f8d33d6cd42c9603b (diff)
parent540b917a262c376f187dda51b4a7988aadef7ef1 (diff)
downloadredis-1012514e0f10aa090eb39c870b82b10724d4d667.tar.gz
Merge pull request #6826 from lifubang/opensslcli
fix ssl args check for redis-cli
-rw-r--r--src/redis-cli.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index 1919829e1..c1bda0a00 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -1595,15 +1595,15 @@ static int parseOptions(int argc, char **argv) {
#ifdef USE_OPENSSL
} else if (!strcmp(argv[i],"--tls")) {
config.tls = 1;
- } else if (!strcmp(argv[i],"--sni")) {
+ } else if (!strcmp(argv[i],"--sni") && !lastarg) {
config.sni = argv[++i];
- } else if (!strcmp(argv[i],"--cacertdir")) {
+ } else if (!strcmp(argv[i],"--cacertdir") && !lastarg) {
config.cacertdir = argv[++i];
- } else if (!strcmp(argv[i],"--cacert")) {
+ } else if (!strcmp(argv[i],"--cacert") && !lastarg) {
config.cacert = argv[++i];
- } else if (!strcmp(argv[i],"--cert")) {
+ } else if (!strcmp(argv[i],"--cert") && !lastarg) {
config.cert = argv[++i];
- } else if (!strcmp(argv[i],"--key")) {
+ } else if (!strcmp(argv[i],"--key") && !lastarg) {
config.key = argv[++i];
#endif
} else if (!strcmp(argv[i],"-v") || !strcmp(argv[i], "--version")) {
@@ -1701,12 +1701,13 @@ static void usage(void) {
" -c Enable cluster mode (follow -ASK and -MOVED redirections).\n"
#ifdef USE_OPENSSL
" --tls Establish a secure TLS connection.\n"
-" --cacert CA Certificate file to verify with.\n"
-" --cacertdir Directory where trusted CA certificates are stored.\n"
+" --sni <host> Server name indication for TLS.\n"
+" --cacert <file> CA Certificate file to verify with.\n"
+" --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"
-" --cert Client certificate to authenticate with.\n"
-" --key Private key file to authenticate with.\n"
+" --cert <file> Client certificate to authenticate with.\n"
+" --key <file> Private key file to authenticate with.\n"
#endif
" --raw Use raw formatting for replies (default when STDOUT is\n"
" not a tty).\n"