wp_remote_post returns an error on SSL connection

I’m using wp_remote_post to post some info to a secure connection like this

$url = 'https://example.com/path/file.json';    

wp_remote_post($url, array(
    'sslverify' => false,
    'timeout'   => 60,
    'body'      => $body,
));

But I get an error:

Read More
SSL: CA certificate set, but certificate verification is disabled

I though sslverifyset to false should prevent that?

If I set sslverify => true it works but may cause problems on other servers

Here’s the complete wp_error object:

WP_Error Object
(
    [errors:WP_Error:private] => Array
        (
            [http_request_failed] => Array
                (
                    [0] => SSL: CA certificate set, but certificate verification is disabled
                )

        )

    [error_data:WP_Error:private] => Array
        (
        )

)

Maybe it’s related but on Apache 2.2 it works while on Apache 2.4 it doesn’t

Related posts

Leave a Reply

1 comment