Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Commit

Permalink
Adding hostkey Algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrichlake committed Sep 12, 2024
1 parent 35ccd0e commit 1aeae90
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/sftp/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,13 @@ func NewSftpHandler(credentialGetter secrets.CredentialGetter) (*SftpHandler, er
return nil, err
}

sftpPasswordSecret := "sftp-password-" + utils.EnvironmentName() // pragma: allowlist secret
sftpPassword, err := credentialGetter.GetSecret(sftpPasswordSecret)
if err != nil {
slog.Error("Unable to get SFTP password secret", slog.String("KeyName", sftpPasswordSecret), slog.Any(utils.ErrorKey, err))
return nil, err
}

config := &ssh.ClientConfig{
User: sftpUser,
Auth: []ssh.AuthMethod{
//ssh.PublicKeys(pem),
ssh.Password(sftpPassword),
ssh.PublicKeys(pem),
},
HostKeyAlgorithms: []string{
ssh.KeyAlgoDSA,
},
HostKeyCallback: hostKeyCallback,
}
Expand Down

0 comments on commit 1aeae90

Please sign in to comment.