diff --git a/CMakeLists.txt b/CMakeLists.txt index 85f44a8ba..c92985d55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,7 +342,7 @@ set(CPACK_RPM_PACKAGE_DESCRIPTION "Contains Memgraph, the graph database. It aims to deliver developers the speed, simplicity and scale required to build the next generation of applications driver by real-time connected data.") # Add `openssl` package to dependencies list. Used to generate SSL certificates. -set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.0.0") +set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.0.0, curl >= 7.29.0") # All variables must be set before including. include(CPack) diff --git a/release/rpm/memgraph.spec.in b/release/rpm/memgraph.spec.in index 500705548..50b9ee153 100644 --- a/release/rpm/memgraph.spec.in +++ b/release/rpm/memgraph.spec.in @@ -69,8 +69,17 @@ chown memgraph:memgraph /var/lib/memgraph || exit 1 chmod 750 /var/lib/memgraph || exit 1 chown memgraph:adm /var/log/memgraph || exit 1 chmod 750 /var/log/memgraph || exit 1 -# Make examples directory immutable (optional) -chattr +i -R /usr/share/memgraph/examples || true + +# Create telemetry directory in examples +for i in /usr/share/memgraph/examples/*; do + # The telemetry directory may already exist from some prior installation + if [ ! -d $i/telemetry ]; then + mkdir $i/telemetry || exit 1 + fi + chown -R memgraph:memgraph $i/telemetry || exit 1 + # Make snapshots directory immutable (optional) + chattr +i -R $i/snapshots || true +done # Generate SSL certificates if [ ! -d /etc/memgraph/ssl ]; then diff --git a/src/communication/context.cpp b/src/communication/context.cpp index 0a2cb9b49..03db468ee 100644 --- a/src/communication/context.cpp +++ b/src/communication/context.cpp @@ -6,7 +6,11 @@ namespace communication { ClientContext::ClientContext(bool use_ssl) : use_ssl_(use_ssl), ctx_(nullptr) { if (use_ssl_) { +#if OPENSSL_VERSION_NUMBER < 0x10100000L + ctx_ = SSL_CTX_new(SSLv23_client_method()); +#else ctx_ = SSL_CTX_new(TLS_client_method()); +#endif CHECK(ctx_ != nullptr) << "Couldn't create client SSL_CTX object!"; // Disable legacy SSL support. Other options can be seen here: @@ -37,7 +41,13 @@ ServerContext::ServerContext() : use_ssl_(false), ctx_(nullptr) {} ServerContext::ServerContext(const std::string &key_file, const std::string &cert_file, const std::string &ca_file, bool verify_peer) - : use_ssl_(true), ctx_(SSL_CTX_new(TLS_server_method())) { + : use_ssl_(true), +#if OPENSSL_VERSION_NUMBER < 0x10100000L + ctx_(SSL_CTX_new(SSLv23_server_method())) +#else + ctx_(SSL_CTX_new(TLS_server_method())) +#endif +{ // TODO (mferencevic): add support for encrypted private keys // TODO (mferencevic): add certificate revocation list (CRL) CHECK(SSL_CTX_use_certificate_file(ctx_, cert_file.c_str(),