libevent icon indicating copy to clipboard operation
libevent copied to clipboard

Missing OpenSSL Documentation

Open isaaczinda opened this issue 5 years ago • 8 comments

I believe that libevent has a dependency on OpenSSL (found this here). However, this isn't documented anywhere on the README and the lack of specifics here created a problem with my install on Windows 10. Steps to repro:

git clone https://github.com/libevent/libevent.git
mkdir libevent/.build
cd libevent/.build
cmake -G "NMake Makefiles" ..

These are the exact steps documented in the README, but gives the error:

CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)

isaaczinda avatar Jun 20 '19 00:06 isaaczinda

There are two steps you should take to resolve this issue:

(1) Install openssl on Windows You can simply download the installation package from here and double click it. Or you can download source code from official website and build/install by yourself, but it is a troublesome case.

(2) set the OPENSSL_ROOT_DIR system variable

set "OPENSSL_ROOT_DIR=D:\tools\OpenSSL-Win64"

Then build following the README.

It is really a frequently asked question, and it is missing in the documentation.

ygj6 avatar Jun 20 '19 12:06 ygj6

Or you can simply disable openssl support with cmake -DEVENT__DISABLE_OPENSSL=ON

@isaaczinda did you resolve your problem?

FWIW @ygj6 added few notes about this in #842

azat avatar Jun 25 '19 22:06 azat

This certainly resolves my issue! #842 is exactly the kind of documentation that would have been helpful to me when building. Once that PR is merged, feel free to close this.

isaaczinda avatar Jun 28 '19 22:06 isaaczinda

I would also like to know which OpenSSL versions are official supported

Croydon avatar Jul 19 '19 16:07 Croydon

For now upstream libevent supports:

  • openssl <1.1
  • openssl >=1.1 (lots of deprecated API and new helpers)
  • libressl
  • and other compatible libs

But libevent 2.0 supports only openssl <1.1 and compatible to it libraries

azat avatar Jul 22 '19 12:07 azat

Does it support openssl3.0?

tiantianaixuexi avatar Jul 16 '20 12:07 tiantianaixuexi

Does it support openssl3.0?

@tiantianaixuexi just tried and yes openssl 3.0 is compatible with openssl 1.1 (but note that you need to compile libevent with openssl 3.0, since I'm not sure that they are ABI compatible).

P.S. although there will be few deprecated API usages, feel free to send PR

azat avatar Jul 22 '20 21:07 azat

Since this PR (https://github.com/libevent/libevent/pull/1028) got merged you might want to add the flag -DEVENT__DISABLE_MBEDTLS=ON or install mbedtls

davinci26 avatar Jul 22 '20 23:07 davinci26