Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wp_remote_post returns an error on SSL connection

Tags:

ssl

wordpress

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:

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

like image 469
Xaver Avatar asked Oct 20 '14 10:10

Xaver


1 Answers

Looks like your Apache 2.2 and 2.4 configurations are different. On 2.4 you probably have SSLVerifyClient set to required which would cause it to act like what you are describing. You'd need to set it to none: http://httpd.apache.org/docs/current/mod/mod_ssl.html#SSLVerifyClient

like image 147
Yavor Avatar answered Sep 29 '22 22:09

Yavor