~axwalk/juju-core/lp1303195-manual-ubuntuuser-bash

« back to all changes in this revision

Viewing changes to environs/httpstorage/storage.go

  • Committer: Roger Peppe
  • Date: 2014-04-11 17:51:58 UTC
  • mto: This revision was merged to the branch mainline in revision 2618.
  • Revision ID: roger.peppe@canonical.com-20140411175158-qxqpgg5svij3pi5m
all: use string certs

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
// storage server at the given network address (see Serve),
50
50
// using TLS. The client is given an authentication key,
51
51
// which the server will verify for Put and Remove* operations.
52
 
func ClientTLS(addr string, caCertPEM []byte, authkey string) (storage.Storage, error) {
 
52
func ClientTLS(addr string, caCertPEM string, authkey string) (storage.Storage, error) {
53
53
        logger.Debugf("using https storage at %q", addr)
54
54
        caCerts := x509.NewCertPool()
55
 
        if caCertPEM != nil {
56
 
                if !caCerts.AppendCertsFromPEM(caCertPEM) {
57
 
                        return nil, errors.New("error adding CA certificate to pool")
58
 
                }
 
55
        if !caCerts.AppendCertsFromPEM([]byte(caCertPEM)) {
 
56
                return nil, errors.New("error adding CA certificate to pool")
59
57
        }
60
58
        return &localStorage{
61
59
                addr:    addr,