| 167 | } |
| 168 | |
| 169 | void tlsCleanup(void) { |
| 170 | if (redis_tls_ctx) { |
| 171 | SSL_CTX_free(redis_tls_ctx); |
| 172 | redis_tls_ctx = NULL; |
| 173 | } |
| 174 | if (redis_tls_client_ctx) { |
| 175 | SSL_CTX_free(redis_tls_client_ctx); |
| 176 | redis_tls_client_ctx = NULL; |
| 177 | } |
| 178 | |
| 179 | #if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) |
| 180 | // unavailable on LibreSSL |
| 181 | OPENSSL_cleanup(); |
| 182 | #endif |
| 183 | } |
| 184 | |
| 185 | /* Callback for passing a keyfile password stored as an sds to OpenSSL */ |
| 186 | static int tlsPasswordCallback(char *buf, int size, int rwflag, void *u) { |
no outgoing calls
no test coverage detected