$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.

link|improve this question
feedback

1 Answer

This doesn't seem to be error coming from WP itself, but is likely generated by curl, which WP likes to pick first for network requests.

I'd try to replicate request with curl by hand on your hosting and elsewhere.

If you are content with doing network request in other way you can tweak to make WP skip curl as transport and go for other options.

link|improve this answer
Do you know what filter I should be using to skip curl for this instance of wp_remote_post without skipping curl for all the other http posts? – Dan Cameron Aug 30 '11 at 22:41
@Dan Cameron I usually use must-have Core Control plugin for debugging network transport issues. – Rarst Aug 30 '11 at 23:04
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.