Here's the code. It's actually C++ but if you can give me the PHP debug info I can translate it without too much trouble.
Thanks!
int CWebGrabber::GetSSLURLPost(std::string host, unsigned int port,
std::string urlin, std::stringstream& content,
std::string postdata, std::string referer)
{
CurlMemory chunk;
chunk.memory = NULL;
chunk.size = 0;
std::stringstream url;
url << "https://";
url << host;
url << urlin;
CURL* curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, url.str().c_str());
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeCurlData);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &chunk);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.5");
curl_easy_setopt(curl, CURLOPT_REFERER, referer.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postdata.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, postdata.size());
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
const int timeout = 30000;
curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout/1000);
CURLcode curlError = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (chunk.memory)
{
content << chunk.memory;
free(chunk.memory);
chunk.memory = NULL;
}
if (content.str().size() == 0)
{
std::stringstream error;
error << "Could not load " << url.str();
error << ". Error message = " << curl_easy_strerror(curlError);
throw std::runtime_error(error.str());
}
return content.str().size() > 0;
}