UMHLens / OpenLens Flatcar Container Linux

How to fix "Error while proxying request: x509: certificate is valid for ..." error

This error might show up in UMHLens / OpenLens when the IP address of the device changed after the installation. This can happen if you got the IP in the installation via DHCP, and then you set it to a different static one.

How to fix "Error while proxying request: x509: certificate is valid for ..." error

Are you getting an Error while proxying request: x509: certificate is valid for ... error in UMHLens / OpenLens after changing the IP address of your device? This is a common issue that can occur when the device's IP address changes from DHCP to static after installation. Fortunately, there are some easy ways to fix this error, and in this article, we'll walk you through two options.

Option 1: basically ignoring the cause (quickest)

If you get an error like this, you need to add insecure-skip-tls-verify: true to the the cluster and remove the ca certificate, so it looks like the screenshot below.

Option 2: adjusting the IP address (permanent, flatcar only)

This option was provided by DanielH from our community. See also the thread on Discord
Before starting, make sure you've updated k3s to at least version 1.23. You can follow the guide at https://docs.k3s.io/upgrades/automated for instructions. 

You can also set your static IP using the guide at https://www.flatcar.org/docs/latest/setup/customization/network-config-with-networkd/.

Once you've changed the IP address, SSH back to the server using the new IP. Follow these steps to reset the cluster and change the IP:

  1. Stop k3s with: sudo systemctl stop k3s
  2. Reset the cluster etcd with: sudo /opt/bin/k3s server --cluster-reset
  3. Start k3s again: sudo systemctl start k3s
  4. Check the status of the server: sudo systemctl status k3s
  5. Change the IP for the cluster in the lens config.
  6. Done! You have successfully changed your server to a static IP.

If you're unsure how to adjust the IP address, the article includes a small script from DanielH that can handle the change. Change the chmod to +xu and run it with sudo. Note that there are no guarantees that it will work, so you may want to add some wait time after changing the IP before running the rest and some feedback from the cluster reset before starting the cluster again.

Stay up-to-date

Subscribe to the UMH Learning Hub Newsletter to receive the latest updates and gain early access to our blog posts.