2013-01-31 67 views
1

關於從源代碼編譯libevent,我只注意到它似乎有依賴於OpenSSL的加密 o_O。libevent:爲什麼它依賴於openssl?

這聽起來像膨脹。

  1. 提供與操作系統無關的異步IO抽象需要加密的庫是什麼?
  2. 如何證明我認爲對OpenSSL的依賴也很大且複雜?

的libevent-2.0.21穩定/ 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. 
+0

我不打算讀libevent來源,那是你的工作,但這裏有一個猜測。也許它有一個通過套接字發送通知的機制,因此需要保護套接字。問題在於國際海事組織太過侷限,只涉及libevent。 –

+0

你似乎混淆了openssl和openssh。你可以請更新你的問題,用openssl替換openssh。 – jrwren

+0

@jrwren感謝您修復標籤! –

回答

2

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(). 

這是爲了您的方便,如果你需要SSL套接字。如果你不需要它,爲什麼不簡單地使用你的問題的自述文件中的選項來禁用它呢?

相關問題