From b0ce29dcfd888a70fe1c8dfdb821285a8148591b Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Sun, 8 Nov 2020 20:28:59 +0000 Subject: [PATCH] ssh: Match newer ssh host key prompt that accepts the fingerprint This fixes an ERROR in test_accept_enforce_host_keys() while running the test suite. Fixes #756 --- docs/changelog.rst | 3 ++- mitogen/ssh.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 8707871b..50e58d31 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,7 +21,8 @@ v0.2.10 (unreleased) To avail of fixes in an unreleased version, please download a ZIP file `directly from GitHub `_. -*(no changes)* +* :gh:issue:`756` ssh connections with `check_host_keys='accept'` would + timeout, when using recent OpenSSH client versions. v0.2.9 (2019-11-02) diff --git a/mitogen/ssh.py b/mitogen/ssh.py index 7a494ed3..656dc72c 100644 --- a/mitogen/ssh.py +++ b/mitogen/ssh.py @@ -72,7 +72,10 @@ PASSWORD_PROMPT_PATTERN = re.compile( ) HOSTKEY_REQ_PATTERN = re.compile( - b(r'are you sure you want to continue connecting \(yes/no\)\?'), + b( + r'are you sure you want to continue connecting ' + r'\(yes/no(?:/\[fingerprint\])?\)\?' + ), re.I )