litespeedtech / litespeedtech/lscache_wp

Using WP-CLI Integration on a Development Environment with Self-signed Certificate

Open
#233 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
257
Forks
123
PR merge metrics
No merged PRs in 30d

Description

I'm setting up a staging server which is a cloned version of a production website and I wrote some shell script to automate the synchronization process and renaming the URLs etc.

The production domain is: `www.example.com`
The staging server domain is: `www.example.test`
Staging server uses native OpenLitespeed webserver and it's IP address is `192.168.1.10`.
OLS is listening on this IP and port 443 for a secure connection and uses a self-signed certificate. (generated via OpenSSL)
I've also added these lines to `/etc/hosts` on the staging server to resolve the .test URLs locally:
```
192.168.1.10 example.test
192.168.1.10 www.example.test
```
I'm trying to use WP-CLI in my script to purge Litespeed cache on the staging server, after a successful sync.
I use this command to purge all cache:
```
wp litespeed-purge all --path=/path/to/wp/files
```
However I get this error:
```
Error: Failed to get url 'https://www.example.test/wp-admin/admin-ajax.php': cURL error 60: Peer's certificate issuer has been marked as not trusted by the user..
```
It seems that litespeed uses cURL to send a request to the site to purge the cache and we know it's possible to use cURL with self-signed certificates using `--insecure` option however I think it's not possible to pass this option directly to `wp litespeed-purge`.

Has anyone encountered this problem before? Can someone give me a point to figure it out?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the `wp litespeed-purge all` command and trace the request to `/wp-admin/admin-ajax.php`, focusing on the reported cURL certificate error. Review how the plugin handles HTTPS requests and determine what behavior is expected for a self-signed certificate; the issue is resolved when the supported staging setup can purge the cache successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.