Fix server cert regeneration; fix check to see if secure connection supported

This branch contains2 fixes.

1. The processing of new state server certificates was incorrectly implemented. This fix uses a custom connection struct to ensure the certificate updates do do occur at the same time as the connection handshake, which is when the cert is used.

2. Upgraded systems are not able to regenerate the state server certificate since the CA cert private key is not recorded. Without the ability to regenerate certs, secure connections cannot be made. A value is added to the agent conf file to indicate whether secure connections are supported. Once we figure out how to do upgrades, this value can be removed. Newly bootstrapped systems will have this value set to true, whereas it will be false for upgraded systems.