func LoadCert(dir string) (*shared.CertInfo, error) {
	prefix := "server"
	if shared.PathExists(filepath.Join(dir, "cluster.crt")) {
		prefix = "cluster"
	}
	cert, err := shared.KeyPairAndCA(dir, prefix, shared.CertServer)
	if err != nil {
		return nil, errors.Wrap(err, "failed to load TLS certificate")
	}
	return cert, nil
}
func LoadCert(dir string) (*shared.CertInfo, error) {
	prefix := "server"
	if shared.PathExists(filepath.Join(dir, "cluster.crt")) {
		prefix = "cluster"
	}
	cert, err := shared.KeyPairAndCA(dir, prefix, shared.CertServer)
	if err != nil {
		return nil, errors.Wrap(err, "failed to load TLS certificate")
	}
	return cert, nil
}
// LoadCert reads the LXD server certificate from the given var dir.
//
// If a cluster certificate is found it will be loaded instead.