$response = wp_remote_post( 'ssl://securesite.com', array(
'method' => 'POST',
'body' => $string, // variable is set
'timeout' => apply_filters( 'http_request_timeout', 15),
'sslverify' => true
));
error_log(print_r($response, TRUE));
if ( is_wp_error($response) ) {
return FALSE;
}
$result = wp_remote_retrieve_body($response);
The result is an error:
[30-Aug-2011 21:53:53] WP_Error Object
(
[errors] => Array
(
[http_request_failed] => Array
(
[0] => Unsupported protocol: ssl
)
)
[error_data] => Array
(
)
)
If I use fsockopen and fgets everything works fine.
Seems like I’m missing an undocumented trick since ssl should be handled by wp_remote_post.