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

Cert issue in Lando local environment #355

Open
cjcodes opened this issue Dec 11, 2017 · 4 comments
Open

Cert issue in Lando local environment #355

cjcodes opened this issue Dec 11, 2017 · 4 comments
Labels

Comments

@cjcodes
Copy link

cjcodes commented Dec 11, 2017

When developing locally with Lando, the certs required for this plugin to work are not installed.

Temporarily, I had to comment out:

  • includes/class-pantheoncurl.php:27
  • includes/includes/class-solrpower-api.php:109
  • includes/includes/class-solrpower-api.php:118

(Line numbers come from the latest version released on wp.org.)

I don't yet have recommended solution steps (in crunch mode on a project), but want to create a placeholder issue or perhaps one of y'all has a good quick solution.

Alternatively, we could look into moving this issue over into the Lando repo to have certs included there, but I think it's a solvable problem on this side. (The certs are installed to /certs in the Docker container, but it's called "index.pem," not "binding.pem".)

@cjcodes cjcodes changed the title Does not work with Lando environment Cert issue in Lando local environment Dec 11, 2017
@danielbachhuber
Copy link
Contributor

Thanks for the report, @cjcodes.

For the public record, I've worked around this issue (error posting schema) by copying the schema.xml file to the correct place on the filesystem. For me, this is ~/solr/solr/conf/schema.xml.

It looks like Lando is defining the PANTHEON_ENVIRONMENT constant as of lando/lando@d600e1c#diff-d02f821273817782be37a9c539342257

@joshkoenig
Copy link
Member

We may want to come to a consensus with the Lando team about how best to handle this. Ideally we can supply a slug of configuration that will make it work with their local environment without any hacking needed.

@cjcodes
Copy link
Author

cjcodes commented Dec 12, 2017

@danielbachhuber Indeed copying the schema.xml helps, but there are two other issues I've run into:

  1. Using the post schema button returns a 204 rather than 200, but still works. Maybe we should check for 2XX responses rather than 200?
  2. Can't connect to the Solr instance (even ping doesn't work) because setting CURLOPT_SSLCERT forces verification against a cert that doesn't exist in Lando world.

@joshkoenig I'll hold on any PRs then until I hear from you--I'm happy to code up the solution by detecting PANTHEON_ENVIRONMENT. There's some consolidation and refactoring that could also be useful related to this.

@jakebellacera
Copy link

Revisiting this.

I'm running a a local Lando environment with the default pantheon recipe. I'm currently looking into enabling Solr and was having trouble enabling the plugin. After some debugging, I noticed that the post schema task which is ran when the plugin is enabled was returning a 204. Modifying includes/includes/class-solrpower-api.php:134 to allow a 204 response allows the plugin to be installed correctly. Afterwards, I am able to successfully ping and index via the plugin settings and WP CLI.

I did not run into any cert issues. Perhaps this was fixed in a future configuration of the pantheon Lando recipe?

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

No branches or pull requests

4 participants