summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2019-08-13 12:51:47 +0300
committerYossi Gottlieb <yossigo@gmail.com>2019-08-13 12:51:47 +0300
commit6d21ffce7c0972665d500413b9f3f113417a1327 (patch)
treecffc4d50166a02b763e420e2e0674302a4e7b5b6
parentf5f855c91239706b173e2412cea301f4a3643e2d (diff)
Silent SSL trace to stdout by default.
-rw-r--r--sslio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sslio.c b/sslio.c
index 25cb5c2..47064db 100644
--- a/sslio.c
+++ b/sslio.c
@@ -8,6 +8,7 @@
void __redisSetError(redisContext *c, int type, const char *str);
+#ifdef HIREDIS_SSL_TRACE
/**
* Callback used for debugging
*/
@@ -37,6 +38,7 @@ static void sslLogCallback(const SSL *ssl, int where, int ret) {
printf("Using SSL version %s. Cipher=%s\n", SSL_get_version(ssl), SSL_get_cipher_name(ssl));
}
}
+#endif
typedef pthread_mutex_t sslLockType;
static void sslLockInit(sslLockType *l) {
@@ -100,7 +102,9 @@ int redisSslCreate(redisContext *c, const char *capath, const char *certpath,
redisSsl *s = c->ssl;
s->ctx = SSL_CTX_new(SSLv23_client_method());
+#ifdef HIREDIS_SSL_TRACE
SSL_CTX_set_info_callback(s->ctx, sslLogCallback);
+#endif
SSL_CTX_set_mode(s->ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
SSL_CTX_set_options(s->ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
SSL_CTX_set_verify(s->ctx, SSL_VERIFY_PEER, NULL);