Are you also doing SSL to the test server ? If not, then check if you have SSLeay and everything required to do SSL (https).
If you where already doing SSL correctly to the test server, then I would check the obvious first. Is the target URL correct and can you reach it from the server you are running the script from ? Can you reach it using lynx, wget or any other client available on that box ?