Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created October 8, 2021 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webtoffee-git/9200655f6b6fbfcfe703c5c8d4e8b1ff to your computer and use it in GitHub Desktop.
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/)
<?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