pkg/ssh: specify ssh-keygen to always generate PEM format

pull/5564/head
Unknwon 2018-12-19 08:31:22 -05:00
parent e2ce6a0dab
commit e70e72e025
3 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ import (
"github.com/gogs/gogs/pkg/setting" "github.com/gogs/gogs/pkg/setting"
) )
const APP_VER = "0.11.83.1218" const APP_VER = "0.11.84.1219"
func init() { func init() {
setting.AppVer = APP_VER setting.AppVer = APP_VER

View File

@ -166,7 +166,7 @@ func Listen(host string, port int, ciphers []string) {
keyPath := filepath.Join(setting.AppDataPath, "ssh/gogs.rsa") keyPath := filepath.Join(setting.AppDataPath, "ssh/gogs.rsa")
if !com.IsExist(keyPath) { if !com.IsExist(keyPath) {
os.MkdirAll(filepath.Dir(keyPath), os.ModePerm) os.MkdirAll(filepath.Dir(keyPath), os.ModePerm)
_, stderr, err := com.ExecCmd(setting.SSH.KeygenPath, "-f", keyPath, "-t", "rsa", "-N", "") _, stderr, err := com.ExecCmd(setting.SSH.KeygenPath, "-f", keyPath, "-t", "rsa", "-m", "PEM", "-N", "")
if err != nil { if err != nil {
panic(fmt.Sprintf("Fail to generate private key: %v - %s", err, stderr)) panic(fmt.Sprintf("Fail to generate private key: %v - %s", err, stderr))
} }

View File

@ -1 +1 @@
0.11.83.1218 0.11.84.1219