diff --git a/sshtunnel.py b/sshtunnel.py index c48e330..90678dc 100644 --- a/sshtunnel.py +++ b/sshtunnel.py @@ -1165,7 +1165,7 @@ def _consolidate_auth(ssh_password=None, if isinstance(ssh_pkey, paramiko.pkey.PKey): ssh_loaded_pkeys.insert(0, ssh_pkey) - if not ssh_password and not ssh_loaded_pkeys: + if ssh_password is None and not ssh_loaded_pkeys: raise ValueError('No password or public key available!') return (ssh_password, ssh_loaded_pkeys) @@ -1410,7 +1410,7 @@ def _connect_to_gateway(self): self.logger.debug('Authentication error') self._stop_transport() - if self.ssh_password: # avoid conflict using both pass and pkey + if self.ssh_password is not None: # avoid conflict using both pass and pkey self.logger.debug('Trying to log in with password: {0}' .format('*' * len(self.ssh_password))) try: