I have an xml file and a GPG signature is in it, in <SIGNATURE>
tag.
Here is the xml:
$xml = "<DATA>
....
<SIGNATURE>-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx
-----END PGP SIGNATURE-----
</SIGNATURE>
</DATA>";
When I send this xml with perl, the respond is ok and remote host accepts the signature.
But if I send this xml with php and cURL, remote server will dismiss the signature.
The next modules are used in perl script: use URI (); use GnuPG qw( :algo ); use LWP::UserAgent (); use IO::Socket::SSL;
Next cURL options are set in the php script:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
I guess there is problem with curl ....Probably a curl setting is missed, but I don't know which. I have tried urlencode
, qoutemeta
php functions for $xml
string, but no results.