" OpenSSL版本太旧了#34;在MacOS 10.11上编译http 2.4.16时

时间:2015-09-22 13:53:16

标签: apache openssl osx-elcapitan

我在El Capitan 10.11.1上编译http 2.4.16时遇到OpenSSL错误。

正在寻找OpenSSL版本> = 0.9.8a

checking for OpenSSL... checking for user-provided OpenSSL base directory... none
checking for OpenSSL version >= 0.9.8a... FAILED
configure: WARNING: OpenSSL version is too old

默认的OpenSSL版本为 0.9.8zg

$ openssl version
OpenSSL 0.9.8zg 14 July 2015

最后这是我的编译行的一部分:

./configure --prefix=/usr/local/MyWebserver/httpd-2.4.12 \
--enable-ssl \
--with-few-things… \
--disable-lots-of-things…

即使使用brew,我也不想安装另一个openssl。

5 个答案:

答案 0 :(得分:4)

对我来说,安装包'openssl-devel'解决了这个问题。

答案 1 :(得分:1)

如果您已经安装了OpenSSL的当前版本(使用Homebrew),则不必复制任何东西,创建一个符号链接足以确保它可以被configure命令获取:

ln -s /usr/local/opt/openssl/include/openssl /usr/local/include

更多详细信息:https://medium.com/@timmykko/using-openssl-library-with-macos-sierra-7807cfd47892

答案 2 :(得分:0)

我找到了办法:

  1. 将文件夹/ usr / incude / openssl从Yosemite(MacOS 10.10)复制到我的计算机上的/ usr / local / include / openssl(El Capitan MacOS 10.11)。
  2. 然后通过向编译环境变量gcc和g ++添加标志来编译apache:-I / usr / local / include
  3. 以下是我使用的所有变量:

    ARCH="-arch x86_64 -mmacosx-version-min=10.7"
    LDFLAGS="-O3 $ARCH"
    CFLAGS="-O3 -fno-common $ARCH"
    CXXFLAGS="-O3 -fno-common $ARCH"
    CC="gcc $ARCH -I/usr/local/include"
    CXX="gcc $ARCH -I/usr/local/include"
    CPP="gcc -E"
    CXXCPP="g++ -E »
    

答案 3 :(得分:0)

实际上,您只需提供标题即可。 下载Openssl源代码here,然后复制到/ usr / local / include /,如下所示,

$ sudo cp -r include/openssl /usr/local/include/

然后一切都会正常。

答案 4 :(得分:0)

以上解决方案均不适用于我。

我通过告诉“配置”使用哪个open-ssl来解决了这个问题:

执行./configure时,请添加以下内容:

  

-with-ssl = / usr / local / Cellar / openssl / 1.0.2r

而1.0.2r是您的openssl当前版本,通常由brew安装。

我更喜欢使用这种方法,而不是搞乱系统文件(例如,不喜欢链接/ usr / ...目录中的任何内容,因为它会干扰系统,尤其是Apple会始终进行更新以防止您无法执行此操作),因此,以下命令有效:

  

./ configure --enable-ssl --enable-so --prefix = /(无论您愿意   安装位置)--with-included-apr --with-mpm = prefork   --with-ssl = / usr / local / Cellar / openssl / 1.0.2r

要使安装正常进行,我还需要下载apr和apr-util,解压缩并将其放置在srclib文件夹中,然后再进行安装。

我希望这会有所帮助。