我安装了 xmlsec,当我尝试验证 XML 文档时它一直给我一个错误。
yum install xmlsec1
yum install xmlsec1-openssl
[vagrant@localhost SSO-ROR-development]$ xmlsec1 --verify ../tmp_SAML_Sample.xml
func=xmlSecCryptoDLLibraryCreate:file=dl.c:line=146:obj=lt_dlopenext:subj=unknown:error=7:io function failed:filename=libxmlsec1-openssl
func=xmlSecCryptoDLGetLibraryFunctions:file=dl.c:line=498:obj=unknown:subj=xmlSecCryptoDLLibraryCreate:error=1:xmlsec library function failed:crypto=openssl
func=xmlSecCryptoDLLoadLibrary:file=dl.c:line=449:obj=unknown:subj=xmlSecCryptoDLGetLibraryFunctions:error=1:xmlsec library function failed:
Error: unable to load xmlsec-openssl library. Make sure that you have
this it installed, check shared libraries path (LD_LIBRARY_PATH)
envornment variable or use "--crypto" option to specify different
crypto engine.
Error: initialization failed
Usage: xmlsec <command> [<options>] [<files>]
Report bugs to http://www.aleksey.com/xmlsec/bugs.html
Written by Aleksey Sanin <[email protected]>.
Copyright (C) 2002-2003 Aleksey Sanin.
This is free software: see the source for copying information.
func=xmlSecCryptoShutdown:file=app.c:line=69:obj=unknown:subj=cryptoShutdown:error=9:feature is not implemented:
func=xmlSecAppCryptoShutdown:file=crypto.c:line=48:obj=unknown:subj=xmlSecCryptoShutdown:error=1:xmlsec library function failed:
Error: xmlsec crypto shutdown failed.
[vagrant@localhost SSO-ROR-development]$ ls $LD_LIBRARY_PATH/*xmlsec*
/usr/lib64/libxmlsec1-openssl.so.1 /usr/lib64/libxmlsec1-openssl.so.1.2.16 /usr/lib64/libxmlsec1.so.1 /usr/lib64/libxmlsec1.so.1.2.16
[root@localhost SSO-ROR-development]# uname -a
Linux localhost.localdomain 2.6.32-279.14.1.el6.x86_64 #1 SMP Tue Nov 6 23:43:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
我相信你已经遇到了这个错误。我刚刚在 CentOS 5 机器和 EPEL 5 上复制了它。如果你问我,这是一个在运输 RPM 中非常糟糕的错误。
幸运的是,解决方法还不错。在正常位置创建符号链接(我通常不推荐)或创建一个目录并将符号链接放在那里并使用 LD_LIBRARY_PATH 指向那里。(我不确定为什么你已经在你的环境中设置了 LD_LIBRARY_PATH ,除非那是一次调试尝试。)
正如我从 strace 输出中看到的
xmlsec1-openssl 查找的是 libxmlsec1-openssl.so 而不是 libxmlsec1-openssl.so.1。你可以试着做这个把戏