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
cURL error with self signed SSL for local dev #179
Comments
Are you able to run cURL for other external network connections inside Local by Flywheel? See http://local.getflywheel.com/community/t/potential-curl-or-ssl-error/7210 |
Hi Dan, on a local install trying to use an external connection to another local site I also got the cURL error 60. My workaround was to implement a filter hook to set
Initially I got the following messages.
but adding the same filter function to two hooks ( get and post ) seems to have resolved the problem. Note: I am using the application-password plugin. |
@danmaby Just wondering if you saw the update above ^? And if so, has that helped? I know I've had to do something similar when working locally on an https site, so hopefully that helps fix the issue. |
@danmaby are you still seeing the cURL error or can we close this issue as resolved? |
Why do you think this has been resolved? Is there a fix? |
Have the same problem on a local vagrant environment. |
@bobbingwide I was curious if @danmaby had been able to resolve it with your instructions, that way I knew more specifically what could resolve his issue within the Distributor codebase. |
@grappler do the edits that @bobbingwide noted solve this for you? |
@danmaby @grappler were either of you able to try the edits suggested by @bobbingwide on this and confirm this is no longer an issue for you locally? |
Setting |
Do you mean you need to test whether or not the request is being run locally? |
I have tested the code locally but I want the connections to ssl verified in production. I think I will be able to work somethings out with the environment constants. Thanks for sharing your |
@grappler were you able to get this to work for you locally? If so, it would be great if you could confirm those details so we can add them to our documentation for others to utilize... thanks! |
@grappler were you able to get this to work for you locally? |
2 similar comments
@grappler were you able to get this to work for you locally? |
@grappler were you able to get this to work for you locally? |
I'm going to close this off due to lack of response. For local development, using this as an mu-plugin ought to resolve any issues with self-signed SSL certificates and/or application passwords preventing the use of an HTTP scheme. Please do not use this in production, it's really not a good idea <?php
namespace Run\This\In\Local\Development\Only\It\Is\Unsafe;
function application_passwords_available () {
return true;
}
function no_scheme_errors( $error ) {
$error->remove( 'invalid_redirect_scheme' );
}
function no_ssl_verify_locally( $args, $url ) {
$self_signed_hosts = array(
'//xu-distributor.local/',
'//ms-distributor.local/',
'//localhost/',
);
foreach( $self_signed_hosts as $host ) {
if ( strpos( $url, $host ) !== false ) {
$args['sslverify'] = false;
}
}
return $args;
}
add_filter( 'wp_is_application_passwords_available', 'Run\\This\\In\\Local\\Development\\Only\\It\\Is\\Unsafe\\application_passwords_available' );
add_action( 'wp_authorize_application_password_request_errors', 'Run\\This\\In\\Local\\Development\\Only\\It\\Is\\Unsafe\\no_scheme_errors' );
add_filter( 'http_request_args', 'Run\\This\\In\\Local\\Development\\Only\\It\\Is\\Unsafe\\no_ssl_verify_locally', 10, 2 ); |
@peterwilsoncc might it be worth adding that to the |
I'm receiving a
cURL error 60
when I install the plugin on a multisite locally with a self signed SSL:The plugin functions as expected when using http://
PHP 7.2
WP 4.9.8 (multisite subdirectory)
Distributor 1.2.2
Local By Flywheel 2.2.4
The text was updated successfully, but these errors were encountered: