diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/example-libevent-ssl.c | 2 | ||||
-rw-r--r-- | examples/example-ssl.c | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/examples/example-libevent-ssl.c b/examples/example-libevent-ssl.c index 7d99af1..d0998ba 100644 --- a/examples/example-libevent-ssl.c +++ b/examples/example-libevent-ssl.c @@ -56,7 +56,7 @@ int main (int argc, char **argv) { const char *caCert = argc > 5 ? argv[6] : NULL; redisSSLContext *ssl; - redisSSLContextError ssl_error; + redisSSLContextError ssl_error = REDIS_SSL_CTX_NONE; redisInitOpenSSL(); diff --git a/examples/example-ssl.c b/examples/example-ssl.c index b8ca442..6d1e32e 100644 --- a/examples/example-ssl.c +++ b/examples/example-ssl.c @@ -12,7 +12,7 @@ int main(int argc, char **argv) { unsigned int j; redisSSLContext *ssl; - redisSSLContextError ssl_error; + redisSSLContextError ssl_error = REDIS_SSL_CTX_NONE; redisContext *c; redisReply *reply; if (argc < 4) { @@ -27,9 +27,8 @@ int main(int argc, char **argv) { redisInitOpenSSL(); ssl = redisCreateSSLContext(ca, NULL, cert, key, NULL, &ssl_error); - if (!ssl) { - printf("SSL Context error: %s\n", - redisSSLContextGetError(ssl_error)); + if (!ssl || ssl_error != REDIS_SSL_CTX_NONE) { + printf("SSL Context error: %s\n", redisSSLContextGetError(ssl_error)); exit(1); } |