Skip to content

Commit c27b723

Browse files
committed
fix(configuration): update Git authentication method and add support for self-signed certificates
1 parent 69f93b9 commit c27b723

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sqle/api/controller/v1/configuration.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import (
44
"context"
55
"crypto/rsa"
66
"fmt"
7+
"net/http"
8+
"os"
9+
710
"github.com/actiontech/dms/pkg/dms-common/dmsobject"
811
"github.com/actiontech/sqle/sqle/errors"
912
"github.com/actiontech/sqle/sqle/utils"
1013
"github.com/go-git/go-git/v5/config"
1114
"github.com/go-git/go-git/v5/plumbing"
12-
"net/http"
13-
"os"
1415

1516
"github.com/actiontech/sqle/sqle/api/controller"
1617
"github.com/actiontech/sqle/sqle/dms"
@@ -419,7 +420,7 @@ func getGitAuthMethod(url, username, password string) (transport.AuthMethod, err
419420
if err != nil {
420421
return nil, err
421422
}
422-
if systemVariable.Data.SystemVariableSSHPrimaryKey != "" {
423+
if systemVariable.Data.SystemVariableSSHPrimaryKey == "" {
423424
return nil, errors.New(errors.DataNotExist, fmt.Errorf("git ssh private key not found"))
424425
}
425426
publicKeys, err := sshTransport.NewPublicKeys("git", []byte(systemVariable.Data.SystemVariableSSHPrimaryKey), "")

0 commit comments

Comments
 (0)