[
https://issues.apache.org/jira/browse/SYNAPSE-150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536719
]
Paul Anderson commented on SYNAPSE-150:
---------------------------------------
Here's my PHP code. I used PHP 4.3.2, OpenSSL 0.9.7a Feb 19 2003, but PHP 5 and
a similar OpenSSL version gave the same result, so the problem should be easy
to reproduce.
I tried the same test on the Oct 17th snapshot binary of Synapse - same result,
even when the 2 filter configurations that I had before were combined into one
filter.
I see the XML message coming into Synapse, being passed on, WS-Sec headers
added, message processed on the remote Geronimo web service, message being
passed back out and logged. But only the headers are returned to the posting
PHP script, not the payload. No error either.
That's what makes me think it's a Synapse problem - the incoming message is
received OK and the http headers go back OK, so it seems there's no keystore
access, cert validity or channel encryption problem. Plain http POST is fine
from PHP - I see the returned payload. And SSL POST is fine when I use Java! So
the config is OK on Synapse.
Help!
<?php
$avariable= "123456";
$sock = fsockopen("ssl://theserver", 9443, $errno, $errstr, 30);
#$sock = fsockopen("theserver", 9080, $errno, $errstr, 30);
if (!$sock) exit("Unable to connect");
socket_set_timeout($sock,60);
$xmlpacket ='<?xml
version="1.0"?><ANXMLPAYLOAD>';$xmlpacket.=$avariable;$xmlpacket.='</ANXMLPAYLOAD>';
#echo "Content-Length: ".strlen($xmlpacket)."\r\n";
$in = "POST /TheService HTTP/1.0\r\n";
$in .="Host: theserver\r\n";
$in .="Content-Type: application/xml; charset=utf-8\r\n";
$in .="Authorization: Basic xyzzy\r\n";
#$in .="Content-Length: ".strlen($xmlpacket)."\r\n";
$in .="\r\n";
$in .=$xmlpacket;
$in .="\r\n";
fputs($sock, $in, strlen($in));
sleep(10);
if ($sock) {
while (!feof($sock)) {
$buffer = fgets($sock, 4096);
echo "Header:".$buffer."*";
}
fclose($sock);
echo "Socket was valid, closed it!";
}
else {
echo "Socket invalid!";
}
?>
> SSL returns headers but no response XML for POX POST from PHP. From Java, OK.
> http POST from PHP, OK. SSL POST from PHP to Tomcat, OK
> -------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SYNAPSE-150
> URL: https://issues.apache.org/jira/browse/SYNAPSE-150
> Project: Synapse
> Issue Type: Bug
> Affects Versions: 1.0
> Environment: JDK6 on RHEL3.
> Reporter: Paul Anderson
> Assignee: Upul Godage
>
> When I use PHP to POST an http 1.0 POX request to Synapse by SSL, Synapse
> replies with http response code and headers only, and then closes the
> connection. No XML is returned.
> Exactly the same PHP POST with plain http receives the XML.
> A Java command line SSL POST receives the XML.
> And PHP POSTing the data to a Tomcat JSP page over SSL works fine - it simply
> receives HTML instead of XML.
> Seems to be something in the Synapse SSL code that is doing the wrong thing,
> and silently.
> I tried setting non-blocking to false - no difference.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]