mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-09-20 00:27:17 +03:00
Merge pull request #3575 from gitbutlerapp/Fix-Gitea
Allow SSH remotes to use any port
This commit is contained in:
commit
31ce4574bd
@ -27,9 +27,12 @@ pub fn check_known_host(remote_url: &git::Url) -> Result<(), Error> {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let port = remote_url.port.unwrap_or(22);
|
||||
|
||||
let mut session = ssh2::Session::new().map_err(Error::Ssh)?;
|
||||
session
|
||||
.set_tcp_stream(std::net::TcpStream::connect(format!("{}:22", host)).map_err(Error::Io)?);
|
||||
session.set_tcp_stream(
|
||||
std::net::TcpStream::connect(format!("{}:{}", host, port)).map_err(Error::Io)?,
|
||||
);
|
||||
session.handshake().map_err(Error::Ssh)?;
|
||||
|
||||
let mut known_hosts = session.known_hosts().map_err(Error::Ssh)?;
|
||||
|
Loading…
Reference in New Issue
Block a user