-
Notifications
You must be signed in to change notification settings - Fork 314
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
Allow self-signed SSL certificates #594
Comments
Hi @blindpet ElasticPress uses |
The issue is the self-signed certificate, the remote request needs to let sslverify=>false exactly as that tutorial says, it would be a valuable option for self-hosters @Ritesh-patel |
Hi @blindpet You can utilise Regards, |
Hi @Ritesh-patel I don't really do php development. I do server configurations. Do you have a snippet I can add to test this? It seems having this as an option would be really useful for external encrypted elasticsearch hosts. The setup would usually be whitelisting the host and using https with a self-signed certificate (since domain names aren't really important for elasticsearch hosting), so having sslverify=> false by default would be ideal. |
Hi @wpbullet You can add following snippet in your theme or in a custom plugin which will set sslveify to false only if it's ElasticPress request.
|
Hello, I am using EP with a self signed certificate, but when adding this code, I get an error: |
Turning off SSL verification - even if it's only an ElasticPress call - is not a solution, and should absolutely NOT be recommended for anybody who actually cares about using SSL properly. I'm running my secured ElasticSearch cluster in Kubernetes alongside Wordpress, and had to wrestle with getting a self-signed certificate to work alongside ElasticPress. This is more of a Wordpress issue than an ElasticPress issue, but there should really be an option to allow for users to specify an absolute path to a certificate file on the server. In lieu of an update that actually addresses the problem rather than telling users to "turn off SSL verification for ElasticPress calls", I've instead updated to append my SSL certificate to the bundle in Wordpress' This too is not a great option, since it doesn't account for use-cases outside of a Kubernetes environment, and having to deal with updates to the core. Instead, I will be looking into offering up a potential workaround by leveraging at least one helpful tool that ElasticPress offers, which is the In theory, the workaround should look something like this:
I'll be playing with this more to determine its viability, but this should at least help point people in the right direction rather than telling them to skip SSL Verification entirely. |
The function that you're looking for was moved under the You can call it via either of the following: Longhand Alias
|
For anybody coming across this issue, ElasticPress has a bug in which attempting to call any remote request filter hooks ( This can lead to the To save you the time and heartache, I have a couple of workarounds outlined in my connected issue listed above. Hopefully this helps. |
I am preparing a tutorial for ElasticPress behind an nginx reverse proxy with basic http auth and whitelisting. I am able to connect from ElasticPress to Elasticsearch with the basic http auth, however when I add a self-signed certificate and change to https in ElasticPress it no longer connects.
This is how I am generating the ssl certificate
sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
and the ssl settings in the nginx virtual host
The text was updated successfully, but these errors were encountered: