System error: null argument to internal routine in xmlsec

System error: null argument to internal routine in xmlsec

我正在尝试在 Django 应用程序中实施 SSO。我有一个 ubuntu 16.04 OS、Apache 和 WSGI 以及 python 3.5.2 我安装的软件包:

xlmsec 1.3.3
lxml 4.5.1
pkg-config 1.5.1
python3-saml 1.9.0

以及 xmlsec 的所有依赖项:libxmlsec1-dev libxml2-dev libxmlsec1-openssl

我的服务器在代理后面(我没有对该服务器的完全访问权限)尝试安装 xlmsec >= 1.3.7 时抛出连接错误,这就是我使用 1.3.3 版本的原因。

一旦我运行以下命令我得到错误:

python -c "import xmlsec"
func=xmlSecOpenSSLAppKeyLoadMemory:file=app.c:line=188:obj=unknown:subj=data != NULL:error=100:assertion:
func=xmlSecCheckVersionExt:file=xmlsec.c:line=185:obj=unknown:subj=unknown:error=19:invalid version:mode=exact;expected minor version=2;real minor version=2;expected subminor version=30;real subminor version=20
func=xmlSecOpenSSLInit:file=crypto.c:line=312:obj=unknown:subj=xmlSecCheckVersionExact:error=1:xmlsec library function failed:
func=xmlSecOpenSSLAppPkcs12Load:file=app.c:line=580:obj=unknown:subj=filename != NULL:error=100:assertion:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: null argument to internal routine

我不确定这是否与错误的版本有关或与 xlmsec 问题有关(我已经尝试回滚到旧版本并遇到同样的问题)。

此问题与安装的 libxmlsec1(ubuntu 软件包)版本有关(版本为 1.2.20,而 xmlsec 需要 1.2.30)。只需删除旧版本并安装新版本。