【问题标题】:Unable to install the Crypt-SSLeay module无法安装 Crypt-SSLeay 模块
【发布时间】:2011-03-08 21:48:08
【问题描述】:

我正在创建一个需要使用 perl 模块 Crypt-SSLeay 的 Web 应用程序。该模块依赖于需要 OpenSSL 标头。由于我的 Linux 服务器没有完成这些安装步骤,但由于我的经验有限,我收到了一个难以理解的错误(见下文)。

服务器信息: 运行 Oracle Enterprise Linux
Linux 版本 2.6.18-194.11.4.0.1.el5 (mockbuild@ca-build9.us.oracle.com) (gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-48))

复制问题的步骤:
here下载并解压openssl 0.9.8r并运行以下命令(进入目录后)

./config --openssldir=/usr/local/openssl
make
make test
sudo make install

here下载并解压Crypt-SSLeay模块,然后运行以下命令(进入目录后)

 perl Makefile.PL
 make

我运行“make”后收到以下错误:

BUILD INFORMATION
================================================
ssl library: OpenSSL 0.9.8r in /usr/local/openssl
ssl header:  openssl/ssl.h
libraries:   -L/usr/local/openssl/lib -lssl -lcrypto -lgcc
include dir: -I/usr/local/openssl/include
================================================
Note (probably harmless): No library found for -lgcc
Writing Makefile for Crypt::SSLeay
The test suite can attempt to connect to public servers
to ensure that the code is working properly. If you are
behind a strict firewall or have no network connectivity,
these tests may fail (through no fault of the code).
Do you want to run the live tests (y/N)? [N] 
-bash-3.2$ make
gcc -c  -I/usr/local/openssl/include -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic   -DVERSION=\"0.58\" -DXS_VERSION=\"0.58\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE"   SSLeay.c
SSLeay.c: In function ‘XS_Crypt__SSLeay__CTX_new’:
SSLeay.c:118: warning: unused variable ‘packname’
SSLeay.c: In function ‘XS_Crypt__SSLeay__Conn_new’:
SSLeay.c:395: warning: unused variable ‘packname’
SSLeay.c: In function ‘XS_Crypt__SSLeay__CTX_use_pkcs12_file’:
SSLeay.c:287: warning: ‘RETVAL’ may be used uninitialized in this function
Running Mkbootstrap for Crypt::SSLeay ()
chmod 644 SSLeay.bs
rm -f blib/arch/auto/Crypt/SSLeay/SSLeay.so
gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic SSLeay.o  -o blib/arch/auto/Crypt/SSLeay/SSLeay.so     \
       -L/usr/local/openssl/lib -lssl -lcrypto      \

/usr/bin/ld: /usr/local/openssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/openssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Crypt/SSLeay/SSLeay.so] Error 1

当我重新编译 OpenSSL 以使该模块工作时,我不确定我需要做什么。任何帮助表示赞赏。

【问题讨论】:

    标签: perl openssl perl-module


    【解决方案1】:

    这看起来像是 OpenSSL 构建本身的错误。您确定您的发行版不提供 OpenSSL 标头吗? (而且我确定你已经有了这些库,对吧?)

    头文件位于 RedHat IIRC 上名为“openssl-devel”的包中,对于 Oracle Enterprise Linux 应该是相同的(我猜,从未使用过)。

    如果您确实在发行版的软件包中找到了标头,请不要忘记卸载您的自定义构建(如果 OpenSSL Makefile 没有卸载目标,请手动删除文件)。

    【讨论】:

    • 找出我错过的东西。当我可以使用命令“sudo yum install openssl-devel”时,我正在编译 OpenSSL。现在一切正常。谢谢!
    • 很高兴您修复了它。不要忘记删除您自定义编译的 openssl 库。他们不应该不伤害任何东西,但是周围有半功能安全库不被安全人员认为是“最佳实践”:-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多