Skip to content

Instantly share code, notes, and snippets.

@schnoggo
Created November 3, 2022 19:05
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 schnoggo/b243945c11c9a5744ba4b5e7a3c8025c to your computer and use it in GitHub Desktop.
Save schnoggo/b243945c11c9a5744ba4b5e7a3c8025c to your computer and use it in GitHub Desktop.
wordpress workaround for local ssl error
<?php
$skip_ssl_verify = false;
$t = ini_get('sendmail_path');
if (
( ( ! empty($t)) and (str_contains( $t, 'flywheel.local')) ) // check for Local by Flywheel default value
or
('local' == substr($_SERVER['SERVER_NAME'], -5) )
or
( true == BYPASS_SSL_VERIFY ) // defined in wp-config
){
$skip_ssl_verify = true;
}
if ($skip_ssl_verify) {
add_filter('https_ssl_verify', '__return_false');
add_filter('https_local_ssl_verify', '__return_false');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment