mirror of
https://github.com/minio/minio.git
synced 2025-01-23 20:53:18 -05:00
fix: same endpoint for NewLDAPIdentity & NewWithCredentials (#9433)
Also enables use of https endpoints Fixes #9431
This commit is contained in:
parent
957ecb1b64
commit
e8160c9fae
@ -21,6 +21,7 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/url"
|
||||
|
||||
miniogo "github.com/minio/minio-go/v6"
|
||||
cr "github.com/minio/minio-go/v6/pkg/credentials"
|
||||
@ -64,8 +65,18 @@ func main() {
|
||||
}
|
||||
fmt.Printf("%#v\n", v)
|
||||
|
||||
stsEndpointUrl, err := url.Parse(stsEndpoint)
|
||||
if err != nil {
|
||||
log.Fatalf("Err: %v", err)
|
||||
}
|
||||
|
||||
secure := false
|
||||
if stsEndpointUrl.Scheme == "https" {
|
||||
secure = true
|
||||
}
|
||||
|
||||
// Use generated credentials to authenticate with MinIO server
|
||||
minioClient, err := miniogo.NewWithCredentials("localhost:9000", li, false, "")
|
||||
minioClient, err := miniogo.NewWithCredentials(stsEndpointUrl.Host, li, secure, "")
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user