Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP XML SSL iis6 Help

Status
Not open for further replies.

sbakker123

Programmer
Aug 24, 2006
6
US
I have an php script on an IIS server. It accepts a post, from a site. It then opens a socket on a xxxx port, and passes info thru that port and waits for a response. After it get's a response, it builds an xml string that it sends back to the original poster.

This all works according to plan, when testing without SSL. When we add SSl a couple of wierd things happen.

The XML returned looks like this
If field x is null the tag comes back <tag/>

<queryall>
<field1>data1</field1>
<field2/>
<field3>data3</field3>
</queryall>

Start Code
--------
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" " ;
echo "<Queryall>" ;

WriteXMLOutput("transeq", $retVal, 0,10);
WriteXMLOutput("returncode", $retVal, 10,4);
-------


function WriteXMLOutput($tag, $retval, $start, $len) {
echo "<" .$tag .">" ;
echo substr($retval, $start, $len);

echo "</" .$tag .">" ;


}

-----

end code


thanks

steve


 
Where are you adding SSL? Between your user and your script or between your script and the other site?

What couple of weird things?



Want the best answers? Ask the best questions! TANSTAAFL!
 

The SSL is on the IIS server. The script

Customer Site -> IIS(ssl) -> php Script -> internal Site
Port 443 Port 3000

The wierdness happens when it looks like SSL strips off the opening tag when there is no data.


Thanks
Steve
 
The error happens when the php sends back a response.

The php (by looking at all the logs) send back
<tag></tag>

but the browser gets back
<tag/>.

This only happens if there is no data in the tag. If there is data, all is cool.
 
The last time I checked the XML specs, "<tag></tag>" and "<tag/>" are functionally equivalent. Without a lot of details about exactly how the data flows through your program flow, it's difficult to say further.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Well,

The client system gets a userNumber, and a charge card#. The client's app posts to my site via a post


The php code opens port 3000 and sends the data to a legacy system. The legacy system responses with a 512 string ofraw data. The php code takes the data and builds a xml string that it sends back.

When this is used on a test site with no certifcat6es, it works, when the same code, pointing to the same legacy systems is used with SSL built onto it, it does not work.

:(
 
Frankly, I don't see how SSL is the cuplrit. There are only one or two differences between the PHP run environment of a script contacted through HTTP and a script contacted through HTTPS.

Again, without knowing what's going on in your script, it's hard to comment.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Problem has been resolved. It was an issue on the client side.

I have to agree tho, SSL just scrambles and descrambles the data going through. The insisted it was our side, but alas.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top