Since Tuesday afternoon we have found that we can't connect to the TEST or SIM servers at SagePay. Live is fine however, even though the exact same code is used.
It's a strange problem as an immediate connection failure is received when attempting to POST a transaction registration to either the test or sim servers.
After this had happened we contacted SagePay support who did some checks but told us that there are no problems on the server. However, when I did a quick Twitter search I found another developer who is also getting this issue. I confirmed the problem via my local development server in the office and on the live server so it doesn't appear to be a specific ISP routing problem etc.
However over the past few day SagePay have confirmed that a small number of user's are having problems. It's most certainy not affecting the majority though.
This has led support to believe that the problem is due to Coldfusion and the way it is sending the POST request to the SagePay server.
Luckily while throwing this problem out to Twitter a very helpful user (@Zefer) suggested that the problem might be due to the server sending back a gzipped response which cfhttp in Coldfusion can't handle (and certain URL functions in PHP it seems). To fix this we just need to send headers to tell the server what we can accept:
<cfhttpparam type="Header" name="TE" value="deflate;q=0">
The raw headers sent in the request will look like this:
Once I made this change the problem went away immediately.
I assume that SagePay must have made a system change on SIM and TEST but not on LIVE (luckily).