Skip to content

Commit

Permalink
Fix: Set connection timeout for the ssh remote host key socket too
Browse files Browse the repository at this point in the history
This allows to adjust the timeout for all ssh connections. Before the
long default timeout was used for this socket connection.
  • Loading branch information
bjoernricks committed Apr 3, 2023
1 parent 8370652 commit f7ec73c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gvm/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def _get_remote_host_key(self):
"""Get the remote host key for ssh connection"""
try:
tmp_socket = socketlib.socket()
tmp_socket.settimeout(self._timeout)
tmp_socket.connect((self.hostname, self.port))
except OSError as e:
raise GvmError(
Expand Down

0 comments on commit f7ec73c

Please sign in to comment.