How to install xmlsec with openssl on Mac OS X

4.6k views Asked by At

I installed xmlsec 1.2.12 on Mac OS X 10.7.3 with OpenSSL 0.9.8w, and after the installation, the tests were all skipped during "make check".

OpenSSL 0.9.8w was installed by

sudo ./config --prefix=/usr/local/ no-asm
sudo make install

xmlsec 1.2.12 by

sudo ./configure --with-openssl=/usr/local/
sudo make install

And I got error message while trying to sign a 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

I also tried xmlsec 1.2.18 and openssl 1.0.1b, but it turned out the same. Is anyone successfully installed xmlsec on Mac OS X 10.7.3? Please give me some advices.

1

There are 1 answers

0
fundidor On

I used MacPorts to install XMLSEC under 10.6, 10.7 and 10.8

MacPorts compiles an openssl package at /opt/local/lib so I use this command to sign an XML file which node to be signed is "infNFe":

export LD_LIBRARY_PATH=/opt/local/lib; /opt/local/bin/xmlsec1 sign --id-attr:Id infNFe --output signed_xmlsec.xml --pkcs12 yourCertificate.pfx --pwd thePasswordHere --trusted-pem yourCertificate.pem unsigned.xml

I think this will fix your issue.