diff --git a/backend/utils/mysql/client.go b/backend/utils/mysql/client.go index 14225adf9..b6f39d945 100644 --- a/backend/utils/mysql/client.go +++ b/backend/utils/mysql/client.go @@ -9,6 +9,7 @@ import ( "github.com/1Panel-dev/1Panel/backend/buserr" "github.com/1Panel-dev/1Panel/backend/constant" + "github.com/1Panel-dev/1Panel/backend/global" "github.com/1Panel-dev/1Panel/backend/utils/mysql/client" ) @@ -50,6 +51,7 @@ func NewMysqlClient(conn client.DBInfo) (MysqlClient, error) { ctx, cancel := context.WithTimeout(context.Background(), time.Duration(conn.Timeout)*time.Second) defer cancel() if err := db.PingContext(ctx); err != nil { + global.LOG.Errorf("test mysql conn failed, err: %v", err) return nil, err } if ctx.Err() == context.DeadlineExceeded { diff --git a/backend/utils/mysql/client/info.go b/backend/utils/mysql/client/info.go index b488d0cf4..9f2ffb6b1 100644 --- a/backend/utils/mysql/client/info.go +++ b/backend/utils/mysql/client/info.go @@ -135,7 +135,6 @@ func ConnWithSSL(ssl, skipVerify bool, clientKey, clientCert, rootCert string) ( return "", errors.New("unable to append root cert to pool") } tlsConfig.RootCAs = pool - tlsConfig.VerifyPeerCertificate = VerifyPeerCertFunc(pool) } if len(clientCert) != 0 && len(clientKey) != 0 { cert, err := tls.X509KeyPair([]byte(clientCert), []byte(clientKey))