Image

Imagejim_smith wrote in Imagephp

Fetching https with curl

For the past couple of weeks I've used the following code to send post requests via https and receive an XML response:

		$ch = curl_init();
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
		ob_start();
		$responseXML = curl_exec($ch);
		ob_end_clean();
		curl_close($ch);


This worked great as recently as this afternoon. Then, suddenly, it completely stopped working. At 4:00 it'd post to http or https, and by 5:30 I couldn't get curl to do anything for any https URL. The strangest thing is that I hadn't touched this code at all in the meantime--it'd been working so well that I hadn't needed to.

Unless my webhost did something funky this evening--and I'm still waiting to hear from them about it--I have to assume I caused this, but I have no idea what I did. What could have happened?