Created
October 8, 2021 11:28
-
-
Save webtoffee-git/9200655f6b6fbfcfe703c5c8d4e8b1ff to your computer and use it in GitHub Desktop.
To fix 'CURL error 60 ( SSL certificate either invalid or expired )'- CookieYes | GDPR Cookie Consent (https://www.webtoffee.com/product/gdpr-cookie-consent/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy this line | |
add_filter( 'http_request_args', function( $params, $url ) { | |
// Check if this is the request from WT GDPR plugin. | |
$allowed_url_patterns = array( | |
'webtoffee.com', | |
'cookieyes.com' | |
); | |
foreach ($allowed_url_patterns as $url_pattern) { | |
if( strpos( $url, $url_pattern) !== false ) { | |
add_filter( 'https_ssl_verify', '__return_false' ); | |
return $params; | |
} | |
} | |
return $params; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment