From fa9fc6fe87eea18ba4c6f6826a338483946e1a68 Mon Sep 17 00:00:00 2001 From: 0xff-dev Date: Tue, 28 Nov 2023 20:45:26 +0800 Subject: [PATCH] fix: config minio secure and skip https authentication --- graphql-server/go-server/pkg/minio/client.go | 12 ++++++++++++ pkg/llms/openai/api.go | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/graphql-server/go-server/pkg/minio/client.go b/graphql-server/go-server/pkg/minio/client.go index ba411277d..a6040be00 100644 --- a/graphql-server/go-server/pkg/minio/client.go +++ b/graphql-server/go-server/pkg/minio/client.go @@ -18,6 +18,8 @@ package minio import ( "context" + "crypto/tls" + "net/http" "os" "sync" @@ -87,6 +89,11 @@ func GetClients() (*minio.Client, *minio.Core, error) { minioClient, err = minio.New(aliasedURL, &minio.Options{ Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""), Secure: secure, + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: true, + }, + }, }) } if err != nil { @@ -100,6 +107,11 @@ func GetClients() (*minio.Client, *minio.Core, error) { coreClient, err = minio.NewCore(aliasedURL, &minio.Options{ Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""), Secure: secure, + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: true, + }, + }, }) } diff --git a/pkg/llms/openai/api.go b/pkg/llms/openai/api.go index bf6ac9e63..413c1b397 100644 --- a/pkg/llms/openai/api.go +++ b/pkg/llms/openai/api.go @@ -64,7 +64,7 @@ func (o *OpenAI) Validate() (llms.Response, error) { return nil, fmt.Errorf("auth is empty") } - testURL := OpenaiModelAPIURL + "/models" + testURL := o.baseURL + "/models" testAuth := "Bearer " + o.apiKey // openAI official requirement req, err := http.NewRequest("GET", testURL, nil)