Encryption libevent:为什么它依赖于openssl?
关于从源代码处编译libevent,我刚刚注意到它似乎依赖OpenSSL进行加密 这听起来像膨胀Encryption libevent:为什么它依赖于openssl?,encryption,openssl,dependencies,libevent,Encryption,Openssl,Dependencies,Libevent,关于从源代码处编译libevent,我刚刚注意到它似乎依赖OpenSSL进行加密 这听起来像膨胀 提供独立于操作系统的异步IO抽象的库需要加密什么 它如何证明对OpenSSL的依赖是合理的?我认为OpenSSL也是巨大而复杂的 libevent-2.0.21-stable/README 38 The configure script also supports the following flags: 39 40 --enable-gcc-warnings Enable ext
libevent-2.0.21-stable/README
38 The configure script also supports the following flags:
39
40 --enable-gcc-warnings Enable extra compiler checking with GCC.
41 --disable-malloc-replacement
42 Don't let applications replace our memory
43 management functions
44 --disable-openssl Disable support for OpenSSL encryption.
45 --disable-thread-support Don't support multithreaded environments.
从
whatsnew-2.0.txt
:
5.4. SSL support for bufferevents with OpenSSL
There is now a bufferevent type that supports SSL/TLS using the
OpenSSL library. The code for this is build in a separate
library, libevent_openssl, so that your programs don't need to
link against OpenSSL unless they actually want SSL support.
There are two ways to construct one of these bufferevents, both
declared in <event2/bufferevent_ssl.h>. If you want to wrap an
SSL layer around an existing bufferevent, you would call the
bufferevent_openssl_filter_new() function. If you want to do SSL
on a socket directly, call bufferevent_openssl_socket_new().
5.4。使用OpenSSL对bufferevents的SSL支持
现在有一种bufferevent类型,它支持使用
OpenSSL库。这方面的代码构建在单独的
库,libevent_openssl,这样您的程序就不需要
链接到OpenSSL,除非他们确实需要SSL支持。
有两种方法可以构造这些bufferevents中的一个,都是
在中声明。如果你想包一个
SSL层围绕现有的bufferevent,您可以调用
bufferevent\u openssl\u filter\u new()函数。如果你想做SSL
在套接字上直接调用bufferevent\u openssl\u socket\u new()。
这是为了方便您,如果您需要SSL套接字。如果您不需要它,为什么不直接使用问题自述片段中的选项禁用它?我不打算阅读libevent源代码,这是您的工作,但这里有一个猜测。也许它有一种通过套接字发送通知的机制,因此需要保护套接字。这个问题在IMO中过于本地化,只与libevent有关。您似乎混淆了openssl和openssh。您能用openssl替换openssh更新您的问题吗。@jrwren感谢您修复标记!