if (strcasecmp(scheme, "https") == 0 || strcasecmp(scheme, "rtsps") == 0) {
ssl = calloc(1, sizeof(*ssl));
hc->hc_ssl = ssl;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
ssl->ctx = SSL_CTX_new(SSLv23_client_method());
+#else
+ ssl->ctx = SSL_CTX_new(TLS_client_method());
+#endif
if (ssl->ctx == NULL) {
tvherror(LS_HTTPC, "%04X: Unable to get SSL_CTX", shortid(hc));
goto err1;
#include <openssl/conf.h>
#include <openssl/err.h>
#include <openssl/rand.h>
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
+#endif
pthread_t main_tid;
sigprocmask(SIG_BLOCK, &set, NULL);
trap_init(argv[0]);
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
/* SSL library init */
OPENSSL_config(NULL);
SSL_load_error_strings();
SSL_library_init();
+#endif
+
/* Rand seed */
randseed.thread_id = (void *)main_tid;
gettimeofday(&randseed.tv, NULL);
if(opt_fork)
unlink(opt_pidpath);
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
/* OpenSSL - welcome to the "cleanup" hell */
+#ifndef OPENSSL_NO_ENGINE
ENGINE_cleanup();
+#endif
RAND_cleanup();
CRYPTO_cleanup_all_ex_data();
EVP_cleanup();
sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
#endif
/* end of OpenSSL cleanup code */
+#endif
#if ENABLE_DBUS_1
extern void dbus_shutdown(void);