diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-10-23 23:20:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 23:20:44 +0800 |
commit | 03900303a9500b33b33ff03fd6dd325147a1117e (patch) | |
tree | a8c09cf6a017bbd420538f4b7983dcda744d5dd9 /modules | |
parent | 9ba789891165c816741254e73ced26d401358da7 (diff) | |
download | gitea-03900303a9500b33b33ff03fd6dd325147a1117e.tar.gz gitea-03900303a9500b33b33ff03fd6dd325147a1117e.zip |
add default ssh ciphers (#2761)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 0be95daadd..c991a1760c 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -108,6 +108,7 @@ var ( StartBuiltinServer: false, Domain: "", Port: 22, + ServerCiphers: []string{"aes128-ctr", "aes192-ctr", "aes256-ctr", "aes128-gcm@openssh.com", "arcfour256", "arcfour128"}, KeygenPath: "ssh-keygen", } @@ -709,7 +710,10 @@ func NewContext() { SSH.Domain = Domain } SSH.RootPath = path.Join(homeDir, ".ssh") - SSH.ServerCiphers = sec.Key("SSH_SERVER_CIPHERS").Strings(",") + serverCiphers := sec.Key("SSH_SERVER_CIPHERS").Strings(",") + if len(serverCiphers) > 0 { + SSH.ServerCiphers = serverCiphers + } SSH.KeyTestPath = os.TempDir() if err = Cfg.Section("server").MapTo(&SSH); err != nil { log.Fatal(4, "Failed to map SSH settings: %v", err) |