Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

fix: prevent SSH timeout infinite loop and enable TCP keepalive#7165

Open
ambv wants to merge 2 commits intolibgit2:mainfrom
ambv:tcp-keepalive
Open

fix: prevent SSH timeout infinite loop and enable TCP keepalive#7165
ambv wants to merge 2 commits intolibgit2:mainfrom
ambv:tcp-keepalive

Conversation

@ambv
Copy link
Contributor

@ambv ambv commented Dec 10, 2025

This PR fixes #7143.

There's two commits here.

The first one makes two improvements:

  1. In case of LIBSSH2_ERROR_TIMEOUT, don't loop forever
  2. Enable TCP keepalive on all sockets to detect dead connections

The added test demonstrates the hang without the patch.

The second commit removes deprecated sshd options from ci/test.sh that were causing warnings with OpenSSH 10.0 in Fedora Rawhide and preventing SSH tests from functioning properly there.

@ambv
Copy link
Contributor Author

ambv commented Dec 12, 2025

This depends on #7167 to have macOS checks green.

ambv added 2 commits December 23, 2025 16:44
This patch makes two improvements:
1. In case of LIBSSH2_ERROR_TIMEOUT, don't loop forever
2. Enable TCP keepalive on all sockets to detect dead connections

The added test demonstrates the hang without the patch.
Remove deprecated OpenSSH configuration options from ci/test.sh:
- Protocol 2 (deprecated since OpenSSH 7.4)
- RSAAuthentication (deprecated since OpenSSH 7.4)
- ChallengeResponseAuthentication (deprecated since OpenSSH 9.6)
- HostCertificate pointing to .pub file (invalid configuration)
- Duplicate HostKey directive

These options were causing warnings with OpenSSH 10.0 in Fedora Rawhide
and preventing SSH tests from functioning properly.

Tested with OpenSSH 10.0p2 on Fedora Rawhide.
@ambv
Copy link
Contributor Author

ambv commented Dec 23, 2025

This is ready for review, @ethomson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Without keepalive set, sockets in ESTABLISHED state can hang forever

1 participant