我正在尝试在项目中使用python-saml工具包(或其中的部分代码),但遇到一些问题,我将尝试解决此问题。在我的本地计算机(ubuntu 18.04)中,我启动并运行了所有程序,但是在centOS计算机中安装它时,我遇到了几个问题。我正在使用(必须使用)的发行版是CentOS 6.8。我构建了所需的所有rpm软件包(依赖项)并安装了它们。我在python-saml代码的以下行中收到错误信息:“无法加载证书”:sign_key.loadCert(file_cert.name, xmlsec.KeyDataFormatCertPem)此loadCert函数是dm.xmlsec.binding软件包的一部分。所以我检查了这个功能,就是这样:def loadCert(self, char *filename, xmlSecKeyDataFormat key_data_format): """load certificate of *key_data_format* from *filename*.""" cdef int rv with nogil: rv = xmlSecCryptoAppKeyCertLoad(self.key, filename, key_data_format) if rv < 0: raise Error("failed to load certificate", filename, rv)好吧,我想这个问题只能存在于“ xmlSecCryptoAppKeyCertLoad”中,因此我检查了该函数,该函数属于XMLSEC库,并定义为:int xmlSecCryptoAppKeyCertLoad(xmlSecKeyPtr key, const char* filename, xmlSecKeyDataFormat format) { if((xmlSecCryptoDLGetFunctions() == NULL) || (xmlSecCryptoDLGetFunctions()->cryptoAppKeyCertLoad == NULL)) { xmlSecNotImplementedError("cryptoAppKeyCertLoad"); return(-1); } return(xmlSecCryptoDLGetFunctions()->cryptoAppKeyCertLoad(key, filename, format));}函数“ loadCert”的参数正确,正确的证书文件名和正确的格式。我在命令行中手动进行了尝试,但遇到了同样的错误(仅在centOS计算机中,Ubuntu中的一切正常)。知道可能是什么问题吗?我将不得不了解正在发生的事情,但是如果有人可以帮助,那就太好了。提前致谢!对于这个问题并不重要,但以防万一可能对其他人有帮助,我在红帽机器中安装dm.xmlsec.binding时遇到问题,我通过按照https://github.com/中的描述构建软件包来解决了该问题。onelogin / python-saml / issues / 30,这意味着将/ usr / bin / xmlsec1-config文件更新为在“ --cflags”中包含“ -DXMLSEC_NO_SIZE_T”。
添加回答
举报
0/150
提交
取消