fix(ssh-tunnel): add password to from_private_key function (#23175)

This commit is contained in:
Hugh A. Miles II 2023-02-24 16:05:37 -08:00 committed by GitHub
parent 196e3eac8b
commit cb9bff72d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,9 +61,10 @@ class SSHManager:
params["ssh_password"] = ssh_tunnel.password
elif ssh_tunnel.private_key:
private_key_file = StringIO(ssh_tunnel.private_key)
private_key = RSAKey.from_private_key(private_key_file)
private_key = RSAKey.from_private_key(
private_key_file, ssh_tunnel.private_key_password
)
params["ssh_pkey"] = private_key
params["ssh_private_key_password"] = ssh_tunnel.private_key_password
return open_tunnel(**params)