Skip to content

Commit 2f49608

Browse files
catch error when client is not compatible
1 parent e74373e commit 2f49608

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ssh_proxy_server/plugins/session/key_negotiation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pkg_resources
55
import yaml
66
from paramiko import Transport, common
7+
from paramiko.ssh_exception import SSHException
78

89
from rich.markup import escape
910
from rich._emoji_codes import EMOJI
@@ -81,6 +82,9 @@ def intercept_key_negotiation(transport, m):
8182

8283

8384
# normal operation
84-
Transport._negotiate_keys(transport, m)
85+
try:
86+
Transport._negotiate_keys(transport, m)
87+
except SSHException as ex:
88+
logging.error(str(ex))
8589

8690
session.transport._handler_table[common.MSG_KEXINIT] = intercept_key_negotiation

0 commit comments

Comments
 (0)