Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loopback check fails on local *.test websites #472

Open
pryley opened this issue Apr 26, 2024 · 1 comment
Open

Loopback check fails on local *.test websites #472

pryley opened this issue Apr 26, 2024 · 1 comment

Comments

@pryley
Copy link

pryley commented Apr 26, 2024

Feature request/bug description

Plugins fail to activate on local websites when using Herd or Laravel Valet (i.e. *.test domains) due to the Loopback sslverify check in wp_remote_get.

$r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );

.test is a reserved top-level domain intended for usage in software testing. It is guaranteed to never be registered into the Internet.
https://en.wikipedia.org/wiki/.test

The Loopback error:

stdClass Object (
    [status] => critical
    [message] => The loopback request to your site failed, this means features relying on them are not currently working as expected.<br>Error encountered: (0) cURL error 60: SSL certificate problem: unable to get local issuer certificate
)

Screenshot:

image

A fix could be as simple as:

add_filter('https_ssl_verify',
    fn ($verify, $url) => str_ends_with(parse_url($url, \PHP_URL_HOST), '.test') ? false : $verify,
    10,
    2,
);

Related issues

#322 and #357

@pryley pryley changed the title Loopback check fails on local *.test websites Loopback check fails on local *.test websites Apr 26, 2024
@szepeviktor
Copy link

Please support all four from the standard.
https://www.rfc-editor.org/rfc/rfc2606.html#section-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants