SalimKazi
SalimKazi

Reputation: 49

Wordpress "CURLOPT_SSL_VERIFYHOST" turned off

I'm working on my wordpress site hosted by a domain (not working in my local environment) I got the error : "Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'curl_setopt', because its argument '$option' content (81) matched the rule 'Please don't turn CURLOPT_SSL_VERIFYHOST off.'" in the function based on the cURL.php file. I downloaded the Cacert.pem file but I don't know where should I put it or should I change something in my cURL.php

Upvotes: 2

Views: 5923

Answers (2)

Hermann
Hermann

Reputation: 31

It error is caused by a snuffleupagus rule(81) which doesn't allow you to disable the test.

Disabling the rule is a security concern and you show rather update the php code.

You can disable the rule on a cpanel server in /usr/share/cagefs/.cpanel.multiphp/opt/cpanel/ea-php74/root/etc/php.d/20-snuffleupagus.rules.d/default.rules

# Ensure that certificates are properly verified
sp.disable_function.function("curl_setopt").param("value").value("1").allow();
sp.disable_function.function("curl_setopt").param("value").value("2").allow();
# `81` is SSL_VERIFYHOST and `64` SSL_VERIFYPEER
#sp.disable_function.function("curl_setopt").param("option").value("64").drop().alias("Please don't turn CURLOPT_SSL_VERIFYCLIENT off.");
#sp.disable_function.function("curl_setopt").param("option").value("81").drop().alias("Please don't turn CURLOPT_SSL_VERIFYHOST off.");

Upvotes: 3

Jasper B
Jasper B

Reputation: 881

Looks like a setting in your hosting, you could try adding this to your themes functions.php

add_filter( 'https_local_ssl_verify', '__return_true' );

https://core.trac.wordpress.org/ticket/50748

Upvotes: 2

Related Questions