Support » Plugins » Hacks » sslverify => false just stopped working for wp_remote_post

  • I was working on my plugin all last week with no troubles, and then last night, my plugin (EWWW Image Optimizer) started throwing warnings about the ssl certificate. I already knew the certs were not valid, because the plugin connects by a dynamically retrieved IP address instead of hostname. So I checked my code, and I’m using the sslverify flag during wp_remote_post to generally ignore the “errors”. Any ideas why this would start happening all of a sudden?

    I have no other plugins active, and using the default twenty fifteen theme on my dev site with PHP 5.6.4 on Ubuntu 15.04.

    Just in case there are any doubts (I wasn’t sure myself), I was doing howto videos on Friday, where I specifically demonstrated the particular functionality which is now throwing the errors.

    UPDATE: I also tried using the ‘https_ssl_verify’ and ‘https_local_ssl_verify’ filters to test the sslverify value, and they both show that it IS already set to false, and I return false via the function just to be safe, and then the error still occurs in the same function call.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The exact error I encounter is this: Warning: stream_socket_client(): Peer certificate CN=optimize.exactlywww.com' did not match expected CN=xxx.xxx.xxx.123′ in /var/www/html/wordpress/wp-includes/class-http.php on line 1021

    I may be able to fix it by re-issuing the cert to be IP-based. However, I found this in the docs for stream_socket_client:

    PHP 5.6.0 – Added peer_fingerprint and verify_peer_name. verify_peer default changed to TRUE.

    I’m still not sure how I never saw this error, as I always have WP_DEBUG enabled on my dev site. Anyway, when I set ‘verify_peer_name’ = FALSE, the Warnings go away.
    I did this on line 986 in the parameters for stream_context_create():

    'verify_peer_name' => FALSE,

    If someone sets ssl_verify to false when calling wp_remote_post (probably ANY related WP functions as well), it seems logical to set verify_peer_name to the matching value. I’ll file a bug/ticket later unless someone else has any ideas.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘sslverify => false just stopped working for wp_remote_post’ is closed to new replies.