Skip to content

Allow set timeout for SSH connection. #6708

Closed
@SuperBo

Description

@SuperBo

Following documentation, there is no way to set timeout for ssh connection.

GIT_OPT_SET_SERVER_CONNECT_TIMEOUT: Sets the timeout (in milliseconds) to attempt connections to > a remote server. This is supported only for HTTP(S) connections > and is not supported by SSH. Set to 0 to use the system default. > Note that this may not be able to be configured longer than the > system default, typically 75 seconds.

Reproduction steps

Expected behavior

This timeout should also apply SSH connection. Libssh2 has an API for setting ssh connection timeout.
https://libssh2.org/libssh2_session_set_timeout.html

Actual behavior

git_remote_fetch hang forever if can't connect to the repository.

Version of libgit2 (release number or SHA1)

v1.7.1

Operating system(s) tested

Mac OS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions