Cannot Retrieve Domain Key

Wordpress LScache Plugin: Cannot Retrieve Domain Key

Hi all Im trying to get a Domain Key within the litespeed cache plugin. Im currently running the site on a jelastic environment based on So Basically a Litespeed ADC and a Litespeed WebServer backed by a MARIADB Cluster. Basically all works fine but getting the domain key returns the following error: 1) The POST callback to failed. The server returns a 401 error. Deactivating all the plugins was not helping at all. Ive also tried a database repair of the litespeed plugin as suggested in another thread. Ive checked a dozen of thread regarding this. Basically i can tell that there is not firewall issue. WAF is deactivate on Litespeed and on the Security Tab if granted access to ALL. I think that wordpress is blocking the request for some reasons, but i dont know why. Looks like it needs a login on the wp-json/litespeed/v1/token the base wp-json/litespeed/v1/token is accessible. So please have a look on the HTACCESS: # BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## RewriteEngine on CacheLookup on RewriteRule . - [E=Cache-Control:no-autoflush] RewriteRule .litespeed_conf .dat - [F,L] ### marker MOBILE start ### RewriteCond % HTTP_USER_AGENT Mobile|Android|Silk/|Kindle|BlackBerry|Opera Mini|Opera Mobi [NC] RewriteRule . - [E=Cache-Control:vary=% ENV:LSCACHE_VARY_VALUE +ismobile] ### marker MOBILE end ### ### marker CACHE RESOURCE start ### RewriteRule wp-content/. /[^/] (responsive|css|js|dynamic|loader|fonts) .php - [E=cache-control:max-age=3600] ### marker CACHE RESOURCE end ### ### marker FAVICON start ### RewriteRule favicon .ico$ - [E=cache-control:max-age=86400] ### marker FAVICON end ### ### marker DROPQS start ### CacheKeyModify -qs:fbclid CacheKeyModify -qs:gclid CacheKeyModify -qs:utm CacheKeyModify -qs:_ga ### marker DROPQS end ### ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## # END LSCACHE # BEGIN NON_LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## # END NON_LSCACHE Header always set Strict-Transport-Security max-age=31536000 # BEGIN WordPress # Die Anweisungen (Zeilen) zwischen ?BEGIN WordPress und ?END WordPress sind # dynamisch generiert und sollten nur ?ber WordPress-Filter ge?ndert werden. # Alle ?nderungen an den Anweisungen zwischen diesen Markierungen werden ?berschrieben. # END WordPress Expand Do you have any hint were I can continue with my investigations? Best Regards, Fabo This topic was modified 10 months, 4 weeks ago by fabo137. The page I need help with: Sorry forgot the report: SWKFDFFU Ive made some further investigations. I still dont have a solution, but an idea. I currently assuming that the lightspeed plugin, especially the function which is failing. Ive found on src/cloud.cls.php the function public function token_validate() which is doing the magic. This one is called by from the rest call and registered in register_rest_route( litespeed/v1, /token, array( methods => POST, callback => array( $this, token ), permission_callback => array( $this, is_from_cloud ), which is making a check if is from cloud. which goes deeper in public function is_from_cloud() if ( empty( $this->_summary[ ips ] ) || empty( $this->_summary[ ips_ts ] ) || time() - $this->_summary[ ips_ts ] > 86400 self::TTL_IPS ) $this->_update_ips() $res = $this->cls( Router )->ip_access( $this->_summary[ ips ] ) if ( ! $res ) self::debug( Not our cloud IP ) // Refresh IP list for future detection $this->_update_ips() else self::debug( Passed Cloud IP verification ) return $res Expand and deeper in private function _update_ips() self::debug( Load remote Cloud IP list from . self::CLOUD_IPS ) $response = wp_remote_get( self::CLOUD_IPS . ?json ) if ( is_wp_error( $response ) ) $error_message = $response->get_error_message() self::debug( failed to get ip whitelist: . $error_message ) throw new Exception( Failed to fetch whitelist . $error_message ) $json = json_decode( $response[ body ], true ) $this->_summary[ ips_ts ] = time() $this->_summary[ ips ] = $json self::save_summary() So i assume the plugin is checking if the origin IP from the caller is from quic cloud. That would explain the reason why I get a 401 when calling the API manually by just navigating to /wp-json/litespeed/v1/token. My IP is not from Cloud. And that brings me to the point that the calling IP from quic cloud to send back the key is failing because the rest api gets a wrong IP. Ive mentioned before that I have whitelist the IPs. So the call will go definitely go through the ADC instance also through the webserver and hits the rest api. However authentication fails. So ive checked litespeed ADC config again and found in the Server ? > GENERAL TAB a setting called: Use Client IP in Header which was set to NO. Im not an Litespeed expert yet but would assume that my Webserver behind the ADC would not get the client IP. Instead I assume it will get the one of the ADC in the request header. ???? (I dont know, I assume) So ive changed this setting to Trusted IPs so assuming ip will be forwarded in the header, because of the fact that quic cloud servers are in the trusted list. Was not working. Ive found this setting on the Litespeed Webserver itself as well. Changed there as well. Also not working. So still not further. For completeness reasons here the whitelist IPs.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, So. No im really confused and disappointed. No idea how to continue, now idea how to fix this. A little hint would probably save my day. Thanks in advance for helping. Regards, Fabo Hi, yes, when there is a proxy , like ADC or any other reverse proxy server in front , LSWS may not receive the real client IP you need to enable that client IP option to ON or trusted IP , in both LSWS and ADC a simple way to verify is that to create a phpinfo page , check the $_SERVER[REMOTE_ADDR] , make sure it shows the visitors IP , instead of any proxy server IP Best regards, ]