Regenerate state server certificate to update SAN attribute with machine IP addresses
Addresses are added to certificate, and consistency checks required when saving
No need to store sevrer cert in state - it is generated on each state server
Turns out we need to store initial state server cert in state so HA works
Drop an error condition unrelated to mongo.
Add a note about what io.EOF means.
Drop "connection is shut down" as well.
Drop the two related tests.
Factor out checkConnectionFailure.
Check for various errnos.
Merge pull request #1276 from ericsnowcurrently/replicaset-IsReady-drop-condition

Drop an error condition unrelated to mongo.

The motivating error actually came from the API client, not mongo.  So leaving the check in might lead a future reader to erroneously believe mongo might produce such an error (or that isConnectionNotAvailable should handle it).

(Review request: http://reviews.vapour.ws/r/591/)
Merge pull request #1241 from wallyworld/update-server-certificate

Regenerate state server certificate to update SAN attribute with machine IP addresses

Fixes: https://bugs.launchpad.net/juju-core/+bug/1397909

A new worker listens to address changes of the state server and regenerates the state server certificate to add the addresses to the SAN list. Then the apiserver is restarted to use the new certificate.

To make this possible, the CA cert private key needs to be available.It is discarded at the moment during cloud init. So now it is included in the StateServingInfo and written to agent conf along with other secrets.

Older juju deployments which are upgraded will not have the CA cert private key available, so the state server certificate cannot be regenerated. An upgrade step will need to be written to create a new CA cert for the environment and ensure the private key is recorded.

(Review request: http://reviews.vapour.ws/r/552/)
Add the backups Add method.
Add the API facade method for backups upload.
Add the API client method for backups upload.
Add BuildMetadata.
Add the backups upload subcommand.
Use an HTTP-based approach.
Add some logging around the API request handling.
Fix (and use) the chained reader.