Showing the changes to docs/debugging (1 of 1 file). Show all
Unified · Split
| @@ -38,6 +38,7 @@ var ( · 37 unmodified lines | ||
| 38 | 38 | bucket, prefix string |
| 39 | 39 | debug bool |
| 40 | 40 | versions bool |
| 41 | + insecure bool | |
| 41 | 42 | ) |
| 42 | 43 | |
| 43 | 44 | // getMD5Sum returns MD5 sum of given data. |
| @@ -55,6 +56,7 @@ func main() { · 11 unmodified lines | ||
| 55 | 56 | flag.StringVar(&prefix, "prefix", "", "Select a prefix") |
| 56 | 57 | flag.BoolVar(&debug, "debug", false, "Prints HTTP network calls to S3 endpoint") |
| 57 | 58 | flag.BoolVar(&versions, "versions", false, "Verify all versions") |
| 59 | + flag.BoolVar(&insecure, "insecure", false, "Disable TLS verification") | |
| 58 | 60 | flag.Parse() |
| 59 | 61 | |
| 60 | 62 | if endpoint == "" { |
| @@ -78,12 +80,23 @@ func main() { · 17 unmodified lines | ||
| 78 | 80 | log.Fatalln(err) |
| 79 | 81 | } |
| 80 | 82 | |
| 83 | + secure := strings.EqualFold(u.Scheme, "https") | |
| 84 | + transport, err := minio.DefaultTransport(secure) | |
| 85 | + if err != nil { | |
| 86 | + log.Fatalln(err) | |
| 87 | + } | |
| 88 | + if insecure { | |
| 89 | + // skip TLS verification | |
| 90 | + transport.TLSClientConfig.InsecureSkipVerify = true | |
| 91 | + } | |
| 92 | + | |
| 81 | 93 | s3Client, err := minio.New(u.Host, &minio.Options{ |
| 82 | − Creds: credentials.NewStaticV4(accessKey, secretKey, ""), | |
| 83 | − Secure: strings.EqualFold(u.Scheme, "https"), | |
| 94 | + Creds: credentials.NewStaticV4(accessKey, secretKey, ""), | |
| 95 | + Secure: secure, | |
| 96 | + Transport: transport, | |
| 84 | 97 | }) |
| 85 | 98 | if err != nil { |
| 86 | − log.Fatalln() | |
| 99 | + log.Fatalln(err) | |
| 87 | 100 | } |
| 88 | 101 | |
| 89 | 102 | if debug { |