My understanding: upgrade using UI (from my firmware version x to version y) SHOULD preserve password and certificate (otherwise it is bug and I will ask you for additional details, I do not observe it)
The single POSSIBLE source of getting factory reset / fresh certificate - upgrade FROM sd card instead of UI (before 41 version where I fixed it). And, of course, upgrade from stock firmware to my firmware
Any update from my firmware (both UI and SD card) to next versions fixed now (version 41) to preserve password/certificate