mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Fix ipv6 parsing for builtin ssh server (#17561)
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
@@ -264,7 +265,7 @@ func sshConnectionFailed(conn net.Conn, err error) {
|
||||
// Listen starts a SSH server listens on given port.
|
||||
func Listen(host string, port int, ciphers []string, keyExchanges []string, macs []string) {
|
||||
srv := ssh.Server{
|
||||
Addr: fmt.Sprintf("%s:%d", host, port),
|
||||
Addr: net.JoinHostPort(host, strconv.Itoa(port)),
|
||||
PublicKeyHandler: publicKeyHandler,
|
||||
Handler: sessionHandler,
|
||||
ServerConfigCallback: func(ctx ssh.Context) *gossh.ServerConfig {
|
||||
|
Reference in New Issue
Block a user