aboutsummaryrefslogtreecommitdiff
path: root/modules/ssh
diff options
context:
space:
mode:
authorspacetourist <guy.callum@gmail.com>2017-02-10 19:04:43 +0000
committer无闻 <u@gogs.io>2017-02-10 14:04:43 -0500
commit29722af1ae51333a7da742b5e02a5e7fe5983aab (patch)
tree281d103accaa2ff9c6321e101307a641d8d8d33d /modules/ssh
parent563fc7c6d7d685678f86ba13e565bafa96f005e0 (diff)
Configurable SSH cipher suite (#4109)
* Configurable SSH cipher suite * Maintain ordering
Diffstat (limited to 'modules/ssh')
-rw-r--r--modules/ssh/ssh.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go
index 025d4b57..bdb58469 100644
--- a/modules/ssh/ssh.go
+++ b/modules/ssh/ssh.go
@@ -148,8 +148,11 @@ func listen(config *ssh.ServerConfig, host string, port int) {
}
// Listen starts a SSH server listens on given port.
-func Listen(host string, port int) {
+func Listen(host string, port int, ciphers []string) {
config := &ssh.ServerConfig{
+ Config: ssh.Config{
+ Ciphers: ciphers,
+ },
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
pkey, err := models.SearchPublicKeyByContent(strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key))))
if err != nil {