-
Notifications
You must be signed in to change notification settings - Fork 273
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
wp_safe_remote_get request to an HTTPS site fails #396
Comments
that bundle should be in the standard WordPress install, but maybe it's not at the right WordPress path? that default is literally |
Sorry for the wrong lead, the ca-bundle file is fine. The function that fails when using Thus a workaround is defining this filter:
|
that's good @akirk - though I guess we could probably also implement that function so it returns |
The |
Nice debugging, thank you ❤️ Sounds like the „hardcode localhost resolution” fix won’t cut it and we need to defer to the OS The
Unrelated trivia: I just learned that dns.lookup() pretends to be asynchronous, but in reality it calls a blocking function: https://httptoolkit.com/blog/configuring-nodejs-dns/ The author discusses a |
Why not just add that filter via a mu-plugin? Accessing localhost (which I believe this code path is trying to prevent) inside the sandbox should not be a problem? |
Oh sorry I didn’t explain - this will be a problem for every site, e.g. in your case it was related to |
About the filter Edit: Issue created here: #400 |
Technically, this filter: add_filter('http_request_host_is_external', '__return_true' ); Can be added as an mu-plugin to Playground in WordPressPatcher (it prepares WordPress for being ran in Playground whenever it's loaded). One other mu-plugin is already added there: wordpress-playground/packages/playground/remote/src/lib/web-wordpress-patches/index.ts Line 10 in 4ff89bf
|
This works as expected with networking enabled (via
@akirk what would you expect to happen instead in that scenario? |
I'm going to close this since I'm not sure if there's an actual problem that needs solving. I'm happy to be wrong here. @akirk feel free to reopen if there's still something that needs to be addressed here. |
Code to reproduce:
returns
I've identified the reason being that this arg is specified:
Maybe that path is not a valid one?
If I directly use
Then it works.
The text was updated successfully, but these errors were encountered: