diff --git a/configure.go b/configure.go index 17404804..5e651a4b 100644 --- a/configure.go +++ b/configure.go @@ -29,11 +29,6 @@ func doMinioConfigure(c *cli.Context) { log.Fatal("Invalid hostname") } - caFile := c.String("cacert") - if caFile == "" { - log.Fatal("invalid CA file") - } - certFile := c.String("cert") if certFile == "" { log.Fatal("invalid certificate") @@ -56,7 +51,6 @@ func doMinioConfigure(c *cli.Context) { // AccessKey: accessKey, // SecretAccessKey: secretKey, Hostname: hostname, - CACert: caFile, CertPEM: certFile, KeyPEM: keyFile, } diff --git a/minio-api-options.go b/minio-api-options.go index 102ef253..3fd95c46 100644 --- a/minio-api-options.go +++ b/minio-api-options.go @@ -122,7 +122,7 @@ var MinioConfigure = cli.Command{ Usage: "Minio access key", }, cli.StringFlag{ - Name: "SecretKey", + Name: "secretKey", Value: "", Usage: "Minio secret key", }, diff --git a/pkg/minio/auth.go b/pkg/minio/auth.go index 3e14cdcc..0bed26ca 100644 --- a/pkg/minio/auth.go +++ b/pkg/minio/auth.go @@ -2,7 +2,6 @@ package minio import ( "crypto/tls" - "crypto/x509" "io/ioutil" "net/http" ) @@ -11,19 +10,17 @@ type Auth struct { AccessKey string SecretAccessKey string Hostname string - CACert string CertPEM string KeyPEM string } type TlsConfig struct { - CABlock []byte CertPEMBlock []byte KeyPEMBlock []byte } func (a *Auth) loadKeys(cert string, key string) (*TlsConfig, error) { - caBlock, err := ioutil.ReadFile(cert) + certBlock, err := ioutil.ReadFile(cert) if err != nil { return nil, err } @@ -32,14 +29,13 @@ func (a *Auth) loadKeys(cert string, key string) (*TlsConfig, error) { return nil, err } t := &TlsConfig{} - t.CABlock = caBlock - t.CertPEMBlock = caBlock + t.CertPEMBlock = certBlock t.KeyPEMBlock = keyBlock return t, nil } func (a *Auth) getTlsTransport() (*http.Transport, error) { - tlsconfig, err := a.loadKeys(a.CACert, a.KeyPEM) + tlsconfig, err := a.loadKeys(a.CertPEM, a.KeyPEM) if err != nil { return nil, err } @@ -49,13 +45,10 @@ func (a *Auth) getTlsTransport() (*http.Transport, error) { return nil, err } - caCertPool := x509.NewCertPool() - caCertPool.AppendCertsFromPEM(tlsconfig.CABlock) - // Setup HTTPS client tlsConfig := &tls.Config{ - Certificates: []tls.Certificate{cert}, - RootCAs: caCertPool, + Certificates: []tls.Certificate{cert}, + InsecureSkipVerify: true, } tlsConfig.BuildNameToCertificate()