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