Why is SwarmAgent crashing after failing to connect to Swarm?

The certificate check failure is ok. You can ignore it.

Could please try to go into the Settings and move the Cache directory into another location that is not under C:/ProgramFiles/, i.e. C:/Temp/SwarmCache/ or something like that?

Also try temporarily enabling verbose logging in the Swarm settings. Perhaps the log will provide some more details then, thanks!