summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--paramiko/client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/paramiko/client.py b/paramiko/client.py
index abfa4cc1..39837c2c 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -617,7 +617,7 @@ class SSHClient (ClosingContextManager):
for pkey_class, filename in keyfiles:
try:
if filename.endswith('-cert.pub'):
- key = pkey_class.from_private_key_file(filename.rstrip('-cert.pub'), password)
+ key = pkey_class.from_private_key_file(filename[:-len('-cert.pub')], password)
key.load_certificate(pubkey_filename=filename)
self._log(
DEBUG,