LXD 4.0 upgrade broke remote connection


after upgrade lxd to 4.0 I am getting.
Error: Get x509: certificate is valid for, ::1, not

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?

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.