XML Digital Signature Failure: Works Locally, Fails on Preproduction Environment

60 Views Asked by At

I'm encountering an issue with XML Digital Signature when attempting to sign an XML file using the xmlsec1 command. The script works flawlessly on my local environment, but fails on the preproduction environment. Below are the details:

The XML FILE link download here

xmlsec1 --sign --output temp/24069-138_signed.xml --id-attr:id Body --privkey-pem /usr/share/nginx/html/libs/routeone/ALMprivatecert.crt,/usr/share/nginx/html/libs/routeone/ALMpubliccert.crt temp/24069-138.xml

Environment Details:

  • xmlsec1 version: 1.2.29 (openssl)

Error Details:

[   
    func=xmlSecTransformNodeRead:file=transforms.c:line=1314:obj=unknown:subj=xmlSecTransformIdListFindByHref:error=1:xmlsec library function failed:href=http://www.w3.org/2000/09/xmldsig#rsa-sha1
    func=xmlSecTransformCtxNodeRead:file=transforms.c:line=595:obj=SignatureMethod:subj=xmlSecTransformNodeRead:error=1:xmlsec library function failed:
    func=xmlSecDSigCtxProcessSignedInfoNode:file=xmldsig.c:line=661:obj=SignatureMethod:subj=xmlSecTransformCtxNodeRead:error=1:xmlsec library function failed:
    func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=497:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec library function failed:
    func=xmlSecDSigCtxSign:file=xmldsig.c:line=291:obj=unknown:subj=xmlSecDSigCtxProcessSignatureNode:error=1:xmlsec library function failed:
    Error: signature failed
    Error: failed to sign file "temp/24069-138.xml"
]

Additional Context:

  • The same script works on the local environment.
  • The xmlsec1 version on both environments is the same (1.2.29).

Questions:

  1. Any ideas on why this might be failing in the preproduction environment?
  2. Could it be related to a difference in the OpenSSL version or configuration?
  3. Suggestions for troubleshooting or debugging this issue?

Thanks in advance for your help!

func=xmlSecTransformNodeRead:file=transforms.c:line=1314:obj=unknown:subj=xmlSecTransformIdListFindByHref:error=1:xmlsec library function failed:href=http://www.w3.org/2000/09/xmldsig#rsa-sha1 func=xmlSecTransformCtxNodeRead:file=transforms.c:line=595:obj=SignatureMethod:subj=xmlSecTransformNodeRead:error=1:xmlsec library function failed: func=xmlSecDSigCtxProcessSignedInfoNode:file=xmldsig.c:line=661:obj=SignatureMethod:subj=xmlSecTransformCtxNodeRead:error=1:xmlsec library function failed: func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=497:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec library function failed: func=xmlSecDSigCtxSign:file=xmldsig.c:line=291:obj=unknown:subj=xmlSecDSigCtxProcessSignatureNode:error=1:xmlsec library function failed: Error: signature failed Error: failed to sign file "temp/24069-138.xml"
0

There are 0 best solutions below