Add skip-verify flag for using self-signed certificates
This commit adds a `skip-verify` flag to the replica configuration so that it can be used with self-signed certificates. This is useful when running a local instance of MinIO with TLS for testing.
This commit is contained in:
9
s3/s3.go
9
s3/s3.go
@@ -3,11 +3,13 @@ package s3
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
@@ -79,6 +81,7 @@ type Replica struct {
|
||||
Path string
|
||||
Endpoint string
|
||||
ForcePathStyle bool
|
||||
SkipVerify bool
|
||||
|
||||
// Time between syncs with the shadow WAL.
|
||||
SyncInterval time.Duration
|
||||
@@ -769,6 +772,12 @@ func (r *Replica) config() *aws.Config {
|
||||
if r.ForcePathStyle {
|
||||
config.S3ForcePathStyle = aws.Bool(r.ForcePathStyle)
|
||||
}
|
||||
if r.SkipVerify {
|
||||
config.HTTPClient = &http.Client{Transport: &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}}
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user