LXD 4.0 upgrade broke remote connection

Hi,

after upgrade lxd to 4.0 I am getting.
Error: Get https://10.10.10.2:8443/1.0: x509: certificate is valid for 127.0.0.1, ::1, not 10.10.10.2

I found that new server.crt and server.key was generated in /var/snap/lxd/common/lxd but without IP address of that lxd server.

How can I regenerate this certificate to include server IP address?

SOLVED:
Fixed by remove server and add again.
lxd remote remove “server”
lxd remote add “server”

Not sure why your certificate got re-generated. LXD only generates certificates if the file is missing…

In any case, the LXD client doesn’t care about the IPs in the cert, that’s just Go being a bit confused, instead the entire certificate is checked against the expected value.

Removing and re-adding the remote is the correct process in case of a certificate change.